Skip to content

Commit

Permalink
Respect receive_updates=False
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick80835 authored and Lonami committed Jan 18, 2025
1 parent 5a0e696 commit 792adb7
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions telethon/client/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ async def _call(self: 'TelegramClient', sender, request, ordered=False, flood_sl

if flood_sleep_threshold is None:
flood_sleep_threshold = self.flood_sleep_threshold
requests = (request if utils.is_list_like(request) else (request,))
for r in requests:
requests = list(request) if utils.is_list_like(request) else [request]
request = list(request) if utils.is_list_like(request) else request
for i, r in enumerate(requests):
if not isinstance(r, TLRequest):
raise _NOT_A_REQUEST()
await r.resolve(self, utils)
Expand All @@ -56,7 +57,11 @@ async def _call(self: 'TelegramClient', sender, request, ordered=False, flood_sl
raise errors.FloodWaitError(request=r, capture=diff)

if self._no_updates:
r = functions.InvokeWithoutUpdatesRequest(r)
if utils.is_list_like(request):
request[i] = functions.InvokeWithoutUpdatesRequest(r)
else:
# This should only run once as requests should be a list of 1 item
request = functions.InvokeWithoutUpdatesRequest(r)

request_index = 0
last_error = None
Expand Down

0 comments on commit 792adb7

Please sign in to comment.