ImportAuthorizationRequest
Both users and bots can use this request. See code examples.
---functions--- auth.importAuthorization#a57a7dad id:long bytes:bytes = auth.Authorization
Returns
| auth.Authorization |
This type can be an instance of either:
| Authorization | AuthorizationSignUpRequired |
Parameters
| id | long | |
| bytes | bytes |
Known RPC errors
This request can cause 2 known errors:
AuthBytesInvalidError | The provided authorization is invalid. |
UserIdInvalidError | Invalid object ID for a user. Make sure to pass the right types, for instance making sure that the request is designed for users or otherwise look for a different one more suited. |
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.ImportAuthorizationRequest(
id=-12398745604826,
bytes=b'arbitrary\x7f data \xfa here'
))
print(result.stringify())