Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Create the client and connect
- client = TelegramClient(username, api_id, api_hash)
- client.start()
- print("Client Created")
- # Ensure you're authorized
- if not client.is_user_authorized():
- client.send_code_request(phone)
- try:
- client.sign_in(phone, input('Enter the code: '))
- except SessionPasswordNeededError:
- client.sign_in(password=input('Password: '))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement