mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-26 19:33:45 +03:00
Fix non-aggressive get_participants and inverted condition
This commit is contained in:
parent
0e0e7f1c9e
commit
57f50889b0
|
@ -1090,6 +1090,9 @@ class TelegramClient(TelegramBareClient):
|
|||
if requests[0].offset > limit:
|
||||
break
|
||||
|
||||
if len(requests) == 1:
|
||||
results = (self(requests[0]),)
|
||||
else:
|
||||
results = self(*requests)
|
||||
for i in reversed(range(len(requests))):
|
||||
participants = results[i]
|
||||
|
@ -1101,9 +1104,9 @@ class TelegramClient(TelegramBareClient):
|
|||
if len(all_participants) < limit:
|
||||
all_participants[user.id] = user
|
||||
if limit < float('inf'):
|
||||
values = all_participants.values()
|
||||
else:
|
||||
values = itertools.islice(all_participants.values(), limit)
|
||||
else:
|
||||
values = all_participants.values()
|
||||
|
||||
users = UserList(values)
|
||||
users.total = total
|
||||
|
|
Loading…
Reference in New Issue
Block a user