Change the way no_updates mode is enabled

See discussion on https://github.com/LonamiWebs/Telethon/commit/49713b2.

The problem with the automatic approach is that some scripts may do
some "fancier" things with the way they register updates, so it was
prone to failure (a handler could be added but since the last request
was without updates, nothing would be received).

This new approach is a bit more annoying to opt-into but also more
explicit.
This commit is contained in:
Lonami Exo
2021-08-29 11:36:08 +02:00
parent befba11657
commit 2cb6cd5dad
3 changed files with 25 additions and 2 deletions

View File

@@ -51,7 +51,7 @@ class UserMethods:
else:
raise errors.FloodWaitError(request=r, capture=diff)
if not self._event_builders and not self._conversations:
if self._no_updates:
r = functions.InvokeWithoutUpdatesRequest(r)
request_index = 0