Added .start() convenience method to quickly connect/authorize (#528)

This commit is contained in:
Joscha Götzer
2018-01-11 12:43:47 +01:00
committed by Lonami
parent eaef392a9b
commit 80f81fe69a
3 changed files with 129 additions and 21 deletions

View File

@@ -39,11 +39,7 @@ Creating a client
phone = '+34600000000'
client = TelegramClient('session_name', api_id, api_hash)
client.connect()
# If you already have a previous 'session_name.session' file, skip this.
client.sign_in(phone=phone)
me = client.sign_in(code=77777) # Put whatever code you received here.
client.start()
Doing stuff