Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from telethon.tl.functions.phone import GetGroupParticipantsRequest
- from telethon.tl.functions.channels import GetFullChannelRequest
- from telethon.utils import get_peer_id
- async def iter_call_participants(chat_id):
- call = (
- await client(GetFullChannelRequest(chat_id))
- ).full_chat.call
- offset = ""
- while True:
- r = await client(
- GetGroupParticipantsRequest(
- call=call,
- ids=[],
- sources=[],
- offset=offset,
- limit=20,
- )
- )
- if not r.next_offset: break
- offset = r.next_offset
- entities = {u.id: u for u in r.users + r.chats}
- for p in r.participants:
- p.entity = entities.get(get_peer_id(p.peer))
- yield p
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement