I did a big project on Python3, a Telegram bot with many functions, due to the scarcity of luggage knowledge and (as I understood it necessary) the wallet on the servers used bot.polling () (I use pyTelegramBotAPI) and literally in half an hour the bot drops. I wrote the usual bot for the response test through time, thinking that it overloaded the project, but no, in fact, the code falls:
import telebot import extras bot = telebot.TeleBot(extras.token) @bot.message_handler(content_types="text") def handler_text(message): bot.send_message(message.from_user.id, 'Все ещё в деле') bot.polling(none_stop=True) Console Error:
During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\MainWindowsPC\AppData\Local\Programs\Python\Python36-32\lib\sit e-packages\telebot\util.py", line 58, in run task(*args, **kwargs) File "D:/Python/test.py", line 10, in handler_text bot.send_message(message.from_user.id, 'Все ещё в деле') File "C:\Users\MainWindowsPC\AppData\Local\Programs\Python\Python36-32\lib\sit e-packages\telebot\__init__.py", line 439, in send_message reply_markup, parse_mode, disable_notification)) File "C:\Users\MainWindowsPC\AppData\Local\Programs\Python\Python36-32\lib\sit e-packages\telebot\apihelper.py", line 135, in send_message return _make_request(token, method_url, params=payload, method='post') File "C:\Users\MainWindowsPC\AppData\Local\Programs\Python\Python36-32\lib\sit e-packages\telebot\apihelper.py", line 54, in _make_request timeout=(connect_timeout, read_timeout), proxies=proxy) File "C:\Users\MainWindowsPC\AppData\Local\Programs\Python\Python36-32\lib\sit e-packages\requests\sessions.py", line 508, in request resp = self.send(prep, **send_kwargs) File "C:\Users\MainWindowsPC\AppData\Local\Programs\Python\Python36-32\lib\sit e-packages\requests\sessions.py", line 618, in send r = adapter.send(request, **kwargs) File "C:\Users\MainWindowsPC\AppData\Local\Programs\Python\Python36-32\lib\sit e-packages\requests\adapters.py", line 490, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected( 'Remote end closed connection without response',)) Something like that. What to do? I don’t want to switch to the webhuk system, I don’t know how, maybe there is a flooring repair?