Skip to content

Instantly share code, notes, and snippets.

@TheRealNoob
Created April 28, 2020 19:52
Show Gist options
  • Save TheRealNoob/869ee5374f633fd78de21ebcb674965e to your computer and use it in GitHub Desktop.
Save TheRealNoob/869ee5374f633fd78de21ebcb674965e to your computer and use it in GitHub Desktop.
from telethon import TelegramClient
import asyncio
client = TelegramClient(...).start()
loop = asyncio.get_event_loop() # == client.loop
me = loop.run_until_complete(client.get_me())
print(me.username)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment