Skip to content Skip to sidebar Skip to footer

Strange Telegram Bot Probem

I have a python Heroku app that hosts a telegram bot. It's using python-telegram-bot. It works perfectly except 1 command.. That command is /reputation. And please read the notes a

Solution 1:

Revoke the bot token that you exposed through the logs or anyone can use your bot.

Also the logs show this:

2021-08-22T12:31:06.705938+00:00 app[web.1]: 2021-08-22 12:31:06,705 - __main__ - WARNING - Update "{'update_id': ...}" caused error "local variable 'f' referenced before assignment"
...
2021-08-22T12:32:37.466462+00:00 app[web.1]: 2021-08-22 12:32:37,466 - __main__ - WARNING - Update "{'update_id': ...}" caused error "Expecting ',' delimiter: line 3 column 2 (char 21)"

This tells you that there are problems in your code that lead to exceptions. python-telegram-bot is designed so that exceptions during runtime don't shut your bot down. My guess is that you have an error handler registered which only logs the exception message, which hides the actual traceback.

To learn more about exception handling in PTB, please have a look at this wiki page and also this example.


Disclaimer: I'm currently the maintainer of python-telegram-bot.


Post a Comment for "Strange Telegram Bot Probem"