mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-02-27 00:40:41 +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)
|
limit = float('inf') if limit is None else int(limit)
|
||||||
if isinstance(entity, InputPeerChannel):
|
if isinstance(entity, InputPeerChannel):
|
||||||
total = self(GetFullChannelRequest(
|
if _total or (aggressive and not filter):
|
||||||
entity
|
total = self(GetFullChannelRequest(
|
||||||
)).full_chat.participants_count
|
entity
|
||||||
if _total:
|
)).full_chat.participants_count
|
||||||
_total[0] = total
|
if _total:
|
||||||
|
_total[0] = total
|
||||||
|
else:
|
||||||
|
total = 0
|
||||||
|
|
||||||
if limit == 0:
|
if limit == 0:
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue
Block a user