from telethon import TelegramClient, sync
api_id = 'APP_ID'
api_hash = 'APP_HASH'
client = TelegramClient('+84_YOUR_PHONE', api_id, api_hash).start()
# get all the channels that I can access
channels = {d.entity.username: d.entity
for d in client.get_dialogs()
if d.is_channel}
print(channels)
# choose the one that I want to list users from
channel = channels['YOUR_GROUP_NAME']
# get all the users and print them
for u in client.get_participants(channel):
print(u.id, u.first_name, u.last_name, u.username)
Create an App and get App ID, App Hash