Search code examples
pythontelegramtelethon

Extract channel members from an unknown Telegram public / private channel


I need a solution, to extract channel members from an unknown Telegram public / private channel. I am not the admin of that channel, But I need those all members list.


Solution

  • 1st of all, are you in the private group?

    Just join the chat first (if not already, done) You don't need to be an admin to extract user list, you just need to be in that group (if it's a private group)

    Getting list of users:

    async for users in client.iter_participants(chat):
        ...