ImportBotAuthorizationRequest

Both users and bots can use this request. See code examples.

---functions---
auth.importBotAuthorization#67a3ff2c flags:int api_id:int api_hash:string bot_auth_token:string = auth.Authorization

Returns

auth.Authorization

This type can be an instance of either:

AuthorizationAuthorizationSignUpRequired

Parameters

flagsint
api_idint
api_hashstring
bot_auth_tokenstring

Known RPC errors

This request can cause 3 known errors:

AccessTokenExpiredErrorBot token expired.
AccessTokenInvalidErrorThe provided token is not valid.
ApiIdInvalidErrorThe api_id/api_hash combination is invalid.

You can import these from telethon.errors.

Example

Please refer to the documentation of client.sign_in() to learn about the parameters and see several code examples on how to use it.

The method above is the recommended way to do it. If you need more control over the parameters or want to learn how it is implemented, open the details by clicking on the "Details" text.

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

with TelegramClient(name, api_id, api_hash) as client:
    result = client(functions.auth.ImportBotAuthorizationRequest(
        flags=42,
        api_id=42,
        api_hash='some string here',
        bot_auth_token='some string here'
    ))
    print(result.stringify())