S
S
Space Around2021-06-21 17:17:14
Python
Space Around, 2021-06-21 17:17:14

How to get a list of users in an open group by id?

How to get a list of users in an open group (not a channel, just a group) by group id using telethon?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Evgeniy _, 2021-06-21
@GeneD88

client.get_participants(target_group, aggressive=True)

https://telethonn.readthedocs.io/en/latest/teletho...

P
Paul Man, 2021-06-22
@itshack

from telethon.sync import TelegramClient

api_id = "your api id"
api_hash = "your api hash"
phone = "your phone"

client = TelegramClient(phone, api_id, api_hash)
client.connect()
if not client.is_user_authorized():
    client.send_code_request(phone)
    client.sign_in(phone, input('Enter the code: '))

print('Fetching Members...')
all_participants = []
all_participants = client.get_participants(my_chat_id, aggressive=True)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question