From 364afd61e1f8152b439b0059c07a2e9adb8b483e Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Sat, 4 Jan 2020 17:22:53 +0100 Subject: [PATCH] Execute get_me() on reconnect This should let Telegram know we still want updates. Ideally, we would catch up, but that requires more work. --- telethon/client/updates.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/telethon/client/updates.py b/telethon/client/updates.py index 3f1f7043..fe19eaaf 100644 --- a/telethon/client/updates.py +++ b/telethon/client/updates.py @@ -502,6 +502,14 @@ class UpdateMethods: async def _handle_auto_reconnect(self: 'TelegramClient'): # TODO Catch-up + # For now we make a high-level request to let Telegram + # know we are still interested in receiving more updates. + try: + await self.get_me() + except Exception as e: + self._log[__name__].warning('Error executing high-level request ' + 'after reconnect: %s: %s', type(e), e) + return try: self._log[__name__].info(