Telethon: Participant count of megagroup/channel

Created on 15 Mar 2018  路  2Comments  路  Source: LonamiWebs/Telethon

Hello. Thanks for the wonderful library.

Is there any way to retrieve a megagroup's exact participant count?

I tried

    dialogs = client.get_dialogs(limit=200)
    for dia in dialogs:
        if isinstance(dia.entity, Channel):
            if dia.entity.megagroup:
                print(dia.entity.participants_count) # None for any megagroup

Also tried

    participants = client(GetParticipantsRequest(
        channel_id, ChannelParticipantsSearch(''), 0, 1,
        hash=0
    ))

    max_limit = participants.count # returns 200 even though the real number of participants is over 100k

I've searched through related issues and docs but didn't find any solution, unfortunately.

Most helpful comment

client.get_participants(where, limit=0).total.

All 2 comments

client.get_participants(where, limit=0).total.

@Lonami thank you

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iranpak picture iranpak  路  3Comments

ghost picture ghost  路  4Comments

aminhyper picture aminhyper  路  3Comments

ksanderer picture ksanderer  路  3Comments

wdsjxh picture wdsjxh  路  3Comments