So currently, I’m trying to create a bot that messages every 5 minutes using python-telegram-bot JobQueue. The app is deployed on heroku and it seems to be working just fine. But sometimes it doesn’t message me after periods of inactivity (ex. not using /start with the bot) How do I solve this issue ? When I check the log it seems to be running fine. Thanks !
Question posted in Telegram API
A comprehensive official documentation can be found here.
A comprehensive official documentation can be found here.
2
Answers
This sounds like you’re using a Heroku instance on a free web dyno which "sleeps" after 30 minutes of inactivity. You can see more information on that here: https://devcenter.heroku.com/articles/free-dyno-hours#dyno-sleeping
Instead of
worker python bot.py
useclock python bot.py
in the Procfile