mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-02-26 16:30:44 +03:00
Don't get full channel on iter_participants unless necessary
This commit is contained in:
parent
4da7df6349
commit
88597f0da8
|
@ -1247,11 +1247,14 @@ class TelegramClient(TelegramBareClient):
|
|||
|
||||
limit = float('inf') if limit is None else int(limit)
|
||||
if isinstance(entity, InputPeerChannel):
|
||||
if _total or (aggressive and not filter):
|
||||
total = self(GetFullChannelRequest(
|
||||
entity
|
||||
)).full_chat.participants_count
|
||||
if _total:
|
||||
_total[0] = total
|
||||
else:
|
||||
total = 0
|
||||
|
||||
if limit == 0:
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue
Block a user