How to get rid of circling clown frog in telegram bot?

100 Views Asked by At

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

1

There are 1 best solutions below

0
On BEST ANSWER

Your Bot API Token leaked to public and now somebody abuses them by sending messages.

To fix that you need to:

  • find out where is a leakage (GitHub, Gist, Pastebin, StackOverflow or some other public service), where you posted bot API Token
  • remove it from there
  • revoke Bot API TOKEN using @BotFather: "Your bot name" -> "API Token" -> "Revoke current token"
  • set new Bot API TOKEN in environment variable on Heroku
  • Redeploy the Heroku

After these it should work properly: on your hosting and without any "clowns"