From 940dfe681650e7e69dc8062aa58698533ae03e85 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Sun, 17 Sep 2017 18:13:58 +0200 Subject: [PATCH] Fix process_updates=True preventing new sessions from signing in --- telethon/telegram_client.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/telethon/telegram_client.py b/telethon/telegram_client.py index dc5b8626..5fc6b1f6 100644 --- a/telethon/telegram_client.py +++ b/telethon/telegram_client.py @@ -967,7 +967,11 @@ class TelegramClient(TelegramBareClient): called automatically on connection if self.updates.enabled = True, otherwise it should be called manually after enabling updates. """ - self.updates.process(self(GetStateRequest())) + try: + self.updates.process(self(GetStateRequest())) + return True + except UnauthorizedError: + return False def add_update_handler(self, handler): """Adds an update handler (a function which takes a TLObject,