ImportLoginTokenRequest

Only users can use this request. See code examples.

---functions---
auth.importLoginToken#95ac5ce4 token:bytes = auth.LoginToken

Returns

auth.LoginToken

This type can be an instance of either:

LoginTokenLoginTokenMigrateTo
LoginTokenSuccess

Parameters

tokenbytes

Known RPC errors

This request can cause 3 known errors:

AuthTokenAlreadyAcceptedErrorThe authorization token was already used.
AuthTokenExpiredErrorThe provided authorization token has expired and the updated QR-code must be re-scanned.
AuthTokenInvalidErrorAn invalid authorization token was provided.

You can import these from telethon.errors.

Example

from telethon.sync import TelegramClient
from telethon import functions, types

with TelegramClient(name, api_id, api_hash) as client:
    result = client(functions.auth.ImportLoginTokenRequest(
        token=b'arbitrary\x7f data \xfa here'
    ))
    print(result.stringify())