This project provides a template for creating Telegram bots using Rust and the Teloxide framework. It includes SQLite database integration, Docker support, and serves as a starting point for building custom Telegram bots.
- Basic bot structure using Teloxide
- SQLite database integration
- Todo list functionality as an example
- Docker support for easy deployment
- Modular architecture for easy expansion
- Rust
- Docker (optional)
- Clone the repository:
git clone https://github.com/ju8sho/teloxide-telegram-bot-template.git
- Navigate to the project directory:
cd telegram-bot-boshlangish
- Set up your Telegram Bot Token:
export TELOXIDE_TOKEN=your_bot_token_here
- Run the bot:
cargo run
-
Build the Docker image:
docker build -t teloxide-telegram-bot-template .
-
Run the container in detached mode:
docker run -d -e TELOXIDE_TOKEN=your_bot_token_here teloxide-telegram-bot-template
Make sure to replace
your_bot_token_here
with your actual Telegram Bot Token. -
To check the running container:
docker ps
-
To view logs:
docker logs [CONTAINER_ID]
Replace [CONTAINER_ID] with the actual container ID from the
docker ps
command. -
To stop the bot:
docker stop [CONTAINER_ID]
Note: The -d
flag runs the container in detached mode, allowing it to run in the background.
- Set the
TELOXIDE_TOKEN
environment variable with your Telegram Bot Token. - Modify the
data.db
path insrc/models/mod.rs
if needed.
Current version: v1.2
For the versions available, see the repository tags.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License. See the LICENSE file for more details.
This is a template project and may require modifications to suit specific bot requirements.