Answer the question
In order to leave comments, you need to log in
Why is the code not running correctly?
There is a code:
from telethon import TelegramClient, sync
api_id = 'мой id'
api_hash = 'мой хэш'
username = 'мой номер'
client = TelegramClient(username, api_id, api_hash).start()
channels = {d.entity.username: d.entity
for d in client.get_dialogs()
if d.is_channel}
for u in client.get_participants(channels['test'], limit=10):
print(u.id, u.first_name, u.last_name, u.username)
Answer the question
In order to leave comments, you need to log in
Maybe you do not see the groups, because you yourself discard them?)
Please pay attention to if d.is_channel
channels = {
d.entity.username: d.entity
for d in client.get_dialogs()
if d.is_channel
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question