From 378ccd17bf623830af4da978d48886ae0b9b5229 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Wed, 25 May 2022 15:31:39 +0200 Subject: [PATCH] Call catch_up before processing updates if the user wants so --- telethon/client/updates.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/telethon/client/updates.py b/telethon/client/updates.py index db5e3f3d..7cfb1e63 100644 --- a/telethon/client/updates.py +++ b/telethon/client/updates.py @@ -247,6 +247,11 @@ class UpdateMethods: async def _update_loop(self: 'TelegramClient'): try: + if self._catch_up: + # User wants to catch up as soon as the client is up and running, + # so this is the best place to do it. + await self.catch_up() + updates_to_dispatch = deque() while self.is_connected():