a guest Apr 23rd, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- from telethon import TelegramClient, sync
- # Use your own values here
- api_id = '123456'
- api_hash = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
- channel = 'channel_name'
- client = TelegramClient('Session_details', api_id, api_hash)
- if not client.is_user_authorized():
- me = client.sign_in(phone_number, input('Enter code: '))
- # get all the users and print them
- for u in client.iter_participants(channel, aggressive=True):
- print(u.id, u.first_name)
RAW Paste Data