Skip to content
This repository has been archived by the owner on Jan 8, 2022. It is now read-only.

Could not deploy to heroku using webhook #15

Closed
aahnik opened this issue Nov 18, 2020 · 2 comments
Closed

Could not deploy to heroku using webhook #15

aahnik opened this issue Nov 18, 2020 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@aahnik
Copy link
Owner

aahnik commented Nov 18, 2020

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

@aahnik aahnik added the help wanted Extra attention is needed label Nov 18, 2020
@aahnik
Copy link
Owner Author

aahnik commented Nov 26, 2020

@aahnik
Copy link
Owner Author

aahnik commented Nov 26, 2020

successfully deployed to heroku, via webhook mode after commit ecc0f64

@aahnik aahnik closed this as completed Nov 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant