A simple template for an asynchronous telegram bot with webhooks to be hosted on the Heroku server.
-
Clone the GitHub repository.
git clone https://github.com/AlexanderKorataev/aiogram-bot-template.git
-
Create a virtual environment.
python -m venv venv
and activate
. venv/bin/activate
-
Install dependencies from requirements.txt.
pip install -r requirements.txt
-
Create environment variables TOKEN and DEBUG.
-
Run the bot script.
python polling.py
-
Create a new application on Heroku and configure
- Add a buildpack heroku/python
- Add config vars DEBUG, TOKEN and HEROKU_APP_NAME
-
Clone the GitHub repository.
git clone https://github.com/AlexanderKorataev/aiogram-bot-template.git
-
Create your Github repository and connect it to Heroku in the Deploy section.
folder | purpose |
---|---|
handlers | handlers of commands and messages sent to the telegram bot |
keyboards | bot keyboards |
plugins | plugins for adding functionality to the bot |
settings | project settings |