mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-29 04:43:45 +03:00
Expose catch_up in client constructor and default it to False
This commit is contained in:
parent
3a44f56f64
commit
dfc6d448ed
|
@ -245,7 +245,8 @@ class TelegramBaseClient(abc.ABC):
|
||||||
system_lang_code: str = 'en',
|
system_lang_code: str = 'en',
|
||||||
loop: asyncio.AbstractEventLoop = None,
|
loop: asyncio.AbstractEventLoop = None,
|
||||||
base_logger: typing.Union[str, logging.Logger] = 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:
|
if not api_id or not api_hash:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
|
@ -429,7 +430,7 @@ class TelegramBaseClient(abc.ABC):
|
||||||
self._megagroup_cache = {}
|
self._megagroup_cache = {}
|
||||||
|
|
||||||
# This is backported from v2 in a very ad-hoc way just to get proper update handling
|
# 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._updates_queue = asyncio.Queue()
|
||||||
self._message_box = MessageBox()
|
self._message_box = MessageBox()
|
||||||
# This entity cache is tailored for the messagebox and is not used for absolutely everything like _entity_cache
|
# This entity cache is tailored for the messagebox and is not used for absolutely everything like _entity_cache
|
||||||
|
|
Loading…
Reference in New Issue
Block a user