Telegram bot template
This is a template for telegram bot that used library aiogram.
This project was created for me to quickly create a telegram bot. I hope it will be useful to you. If you have any suggestions, please write to me, I will be glad to hear them.
You can use it as a basis for your project. This template ready for run as a docker container. There are a few simple examples of handlers.
Write your logic in the bot_lib/
directory.
Handlers place in the handlers/
directory and connect them in the bot.py
file.
How to run in docker
- Clone the repository.
- Run
docker-compose up -d
and wait for the build to finish.
Structure
bot.py
: point of entry into the botbot_lib/
: place here the logic of the bot, additional functionsbot_lib/bot_create.py
: creating Dispatcher, CallbackData, Storage and other instancesbot_lib/settings.py
: the bot settingshandlers/
: handlers for bot commandshandlers/message_handlers.py
: handlers for user messageshandlers/callback_handlers.py
: handlers for callback requestskeyboards/
: keyboards for botkeyboards/common_keyboards.py
: additional functions for creating keyboardsDockerfile
: file for building docker imagedocker-compose.yml
: used to run the botrequirements.txt
: list of package dependencies
Description
Languages
Python
89.8%
Dockerfile
10.2%