From dfc6d448edbe4764b526c0445c89df9f9d51a8a6 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Fri, 20 May 2022 14:55:47 +0200 Subject: [PATCH] Expose catch_up in client constructor and default it to False --- telethon/client/telegrambaseclient.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/telethon/client/telegrambaseclient.py b/telethon/client/telegrambaseclient.py index 1c52bb2f..7f154a97 100644 --- a/telethon/client/telegrambaseclient.py +++ b/telethon/client/telegrambaseclient.py @@ -245,7 +245,8 @@ class TelegramBaseClient(abc.ABC): system_lang_code: str = 'en', loop: asyncio.AbstractEventLoop = None, base_logger: typing.Union[str, logging.Logger] = None, - receive_updates: bool = True + receive_updates: bool = True, + catch_up: bool = False ): if not api_id or not api_hash: raise ValueError( @@ -429,7 +430,7 @@ class TelegramBaseClient(abc.ABC): self._megagroup_cache = {} # This is backported from v2 in a very ad-hoc way just to get proper update handling - self._catch_up = True + self._catch_up = catch_up self._updates_queue = asyncio.Queue() self._message_box = MessageBox() # This entity cache is tailored for the messagebox and is not used for absolutely everything like _entity_cache