Skip to content

Instantly share code, notes, and snippets.

@Aero-Blue
Created January 9, 2020 22:00
Show Gist options
  • Save Aero-Blue/5f053b49b3a94a4c0faefe73070f0dd5 to your computer and use it in GitHub Desktop.
Save Aero-Blue/5f053b49b3a94a4c0faefe73070f0dd5 to your computer and use it in GitHub Desktop.
Simple Telegram login example
from telethon.sync import TelegramClient # Imports
API_ID = 123456
API_HASH = "cje94230424jlesaferj23432042cc"
PHONE_NUMBER = "+12345678900"
with TelegramClient(PHONE_NUMBER, API_ID, API_HASH) as client:
account = client.get_me() # All your account info
print(f"Logged in as {account.username}!") # Output to console
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment