I have a python script with python-telegram-bot module hosted on Heroku with Free dyno enabled. My code was running correctly for 2 years on it. Last night I decided to update my code. After I uploaded the code on Heroku, I realized that the dyno after getting shut down, doesn't wake up with the requests made by the bot.
The dyno and the app actually do not get started to handle the requests of the users after 30 minutes inactivity of the Heroku app.
On the other hand, the bot replies with a circling clown sticker made by MrSnowBall to every request you made for it!!!
Here is the Webhook code of my script:
updater = Updater(TOKEN)
dispatcher = updater.dispatcher
#dispathcers here
PORT = int(os.environ.get('PORT', '5000'))
updater.start_webhook(listen="0.0.0.0", port=PORT, url_path=TOKEN)
updater.bot.setWebhook("https://[my app name].herokuapp.com/" + TOKEN)
updater.idle()
And here is the reply I get from the Bot for every interaction: Circling Clown Frog of Telegram Bot
If you want to check the Bot yourself and see it in action, you can find it on @IranAIPBot
Your Bot API Token leaked to public and now somebody abuses them by sending messages.
To fix that you need to:
API Token
"Your bot name"
->"API Token"
->"Revoke current token"
After these it should work properly: on your hosting and without any "clowns"