I have rewritten the bot and made it work in an asynchronous fashion. Currently (v0.1.0), the bot uses aiogram.
The bot is working fine when it is run via polling. I have tested the bot via polling mode both locally ✔️ and on Heroku ✔️
The start.py is the script to start the bot. You must have an environment variable named BOT_API_TOKEN. The value of this should be equal to the token you obtained from @BotFather.
Tip: Instead of setting the env variable you may create a file token.txt in the root of the project, with the value of the token.
To start the bot via polling simply run the script start.py.
To run the bot via webhook:
You have to set some additional environment variables:
APP_NAME = subdomain ( the name of your Heroku project )
DOMAIN = domain ( like herokuapp )
( your URL will be https://{APP_NAME}.{DOMAIN}.com )
METHOD = 'webhook' ( start.py will start webhook, if this env variable is present )
While starting the bot via webhook, no errors are being shown, but the bot is not responding. For setting up webhook, I have followed this example given in the official repo of aiogram
I have rewritten the bot and made it work in an asynchronous fashion. Currently (v0.1.0), the bot uses
aiogram
.The bot is working fine when it is run via
polling
. I have tested the bot via polling mode both locally ✔️ and on Heroku ✔️The
start.py
is the script to start the bot. You must have an environment variable namedBOT_API_TOKEN
. The value of this should be equal to the token you obtained from @BotFather.To start the bot via polling simply run the script
start.py
.To run the bot via webhook:
You have to set some additional environment variables: APP_NAME = subdomain ( the name of your Heroku project ) DOMAIN = domain ( like
herokuapp
)METHOD = 'webhook' ( start.py will start webhook, if this env variable is present )
While starting the bot via webhook, no errors are being shown, but the bot is not responding. For setting up webhook, I have followed this example given in the official repo of
aiogram