Answer the question
In order to leave comments, you need to log in
Why is the python telegram bot shutting down?
writing a bot and using pyTelegramBotApi in Python!
The problem is the following: The
bot is turned off and there is the following error:
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
Telegram is already unblocked in Russia! So not because of blocking, apihelper does not help ...
I googled, but I did not find any new solutions other than apihelper
Answer the question
In order to leave comments, you need to log in
The fact that it was unlocked does not mean that this is not the problem.
Everything is purely a connection error, so think about how to fix it.
Very slow Internet is possible
Faced a similar problem - the bot crashes with this error if you write to him after a long period of silence. The problem here is that at some point the session times out; if after this moment the bot tries to send a message, it will crash with an error. Analysis of this situation - here https://github.com/eternnoir/pyTelegramBotAPI/issu... , the solution is also given there - register
apihelper.SESSION_TIME_TO_LIVE = 5 * 60
If this is done, a session older than five minutes will be considered inactive and restarted; an alternative is to wrap each bot.send_message in a try and try to resend the message after failure.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question