Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from telethon import TelegramClient, events
- api_id = ********
- api_hash = "****************************"
- client = TelegramClient('my_account', api_id, api_hash)
- @client.on(events.NewMessage)
- async def my_event_handler(event):
- print(event.peer_id)
- client.start()
- client.run_until_disconnected()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement