Answer the question
In order to leave comments, you need to log in
How to solve the problem with the telebot library so that the bot does not interrupt its work?
In short, the bot works for 10-20 minutes and then if you send something to it, it writes the remote host forcibly broke the work something like that, yes, I know there are solutions to use aiogram, but the bot is already written on telebot, how can I cheat?
Answer the question
In order to leave comments, you need to log in
make a while loop and put the whole structure in try: except:
that is,
while True:
try:
...
bot code
...
except Exception as error:
print('Error:' , error)
The bot will loop, if an error occurs, the process will be resumed
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question