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,7 +1090,10 @@ class TelegramClient(TelegramBareClient):
|
|||
if requests[0].offset > limit:
|
||||
break
|
||||
|
||||
results = self(*requests)
|
||||
if len(requests) == 1:
|
||||
results = (self(requests[0]),)
|
||||
else:
|
||||
results = self(*requests)
|
||||
for i in reversed(range(len(requests))):
|
||||
participants = results[i]
|
||||
if not participants.users:
|
||||
|
@ -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