From 49713b27844889272bfdbfa5bcde35c5dd2c74a9 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Sun, 22 Aug 2021 13:38:54 +0200 Subject: [PATCH] Wrap requests in InvokeWithoutUpdatesRequest if no event handlers Closes #1270. --- telethon/client/users.py | 3 +++ telethon/events/callbackquery.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/telethon/client/users.py b/telethon/client/users.py index 49408896..7881cbd9 100644 --- a/telethon/client/users.py +++ b/telethon/client/users.py @@ -51,6 +51,9 @@ class UserMethods: else: raise errors.FloodWaitError(request=r, capture=diff) + if not self._event_builders and not self._conversations: + r = functions.InvokeWithoutUpdatesRequest(r) + request_index = 0 last_error = None self._last_request = time.time() diff --git a/telethon/events/callbackquery.py b/telethon/events/callbackquery.py index d1558d21..94e03b7b 100644 --- a/telethon/events/callbackquery.py +++ b/telethon/events/callbackquery.py @@ -135,7 +135,7 @@ class CallbackQuery(EventBuilder): The object returned by the ``data=`` parameter when creating the event builder, if any. Similar to ``pattern_match`` for the new message event. - + pattern_match (`obj`, optional): Alias for ``data_match``. """