1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

Update async_telebot.py

This commit is contained in:
_run 2022-07-13 21:52:48 +05:00 committed by GitHub
parent 0b5b7ad39a
commit 659501efef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -136,7 +136,7 @@ class AsyncTeleBot:
return [types.Update.de_json(ju) for ju in json_updates] return [types.Update.de_json(ju) for ju in json_updates]
async def polling(self, non_stop: bool=False, skip_pending=False, interval: int=0, timeout: int=20, async def polling(self, non_stop: bool=False, skip_pending=False, interval: int=0, timeout: int=20,
request_timeout: int=20, allowed_updates: Optional[List[str]]=None, request_timeout: int=None, allowed_updates: Optional[List[str]]=None,
none_stop: Optional[bool]=None): none_stop: Optional[bool]=None):
""" """
This allows the bot to retrieve Updates automatically and notify listeners and message handlers accordingly. This allows the bot to retrieve Updates automatically and notify listeners and message handlers accordingly.
@ -169,7 +169,7 @@ class AsyncTeleBot:
await self.skip_updates() await self.skip_updates()
await self._process_polling(non_stop, interval, timeout, request_timeout, allowed_updates) await self._process_polling(non_stop, interval, timeout, request_timeout, allowed_updates)
async def infinity_polling(self, timeout: int=20, skip_pending: bool=False, request_timeout: int=20, logger_level=logging.ERROR, async def infinity_polling(self, timeout: int=20, skip_pending: bool=False, request_timeout: int=None, logger_level=logging.ERROR,
allowed_updates: Optional[List[str]]=None, *args, **kwargs): allowed_updates: Optional[List[str]]=None, *args, **kwargs):
""" """
Wrap polling with infinite loop and exception handling to avoid bot stops polling. Wrap polling with infinite loop and exception handling to avoid bot stops polling.
@ -208,7 +208,7 @@ class AsyncTeleBot:
logger.error("Break infinity polling") logger.error("Break infinity polling")
async def _process_polling(self, non_stop: bool=False, interval: int=0, timeout: int=20, async def _process_polling(self, non_stop: bool=False, interval: int=0, timeout: int=20,
request_timeout: int=20, allowed_updates: Optional[List[str]]=None): request_timeout: int=None, allowed_updates: Optional[List[str]]=None):
""" """
Function to process polling. Function to process polling.