N
N
new_year20212020-12-21 21:50:29
Bots
new_year2021, 2020-12-21 21:50:29

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

1 answer(s)
N
Noobick361254, 2020-12-22
@Noobick361254

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 question

Ask a Question

731 491 924 answers to any question