From 30b42356ab151090a51b5d1451a6ad9dbbacdddf Mon Sep 17 00:00:00 2001 From: Dmitrii Morozov Date: Wed, 8 May 2024 14:31:01 +0200 Subject: non-stop telebot polling --- telegram_bot/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'telegram_bot/__init__.py') diff --git a/telegram_bot/__init__.py b/telegram_bot/__init__.py index ab9f61d..95b7af8 100644 --- a/telegram_bot/__init__.py +++ b/telegram_bot/__init__.py @@ -26,7 +26,10 @@ class TelegramBot: exception_handler=ExceptionHandler()) async def run(self): - await self.__bot.polling() + await self.__bot.polling( + non_stop=True, + timeout=100 + ) def register_command_handler(self, command: str, command_handler: CommandHandler): self.__bot.register_message_handler( -- cgit v1.2.3