auth.importBotAuthorization
Login as a bot
func (c *Client) AuthImportBotAuthorization(ctx context.Context, request *AuthImportBotAuthorizationRequest) (AuthAuthorizationClass, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.AuthImportBotAuthorization(ctx, &tg.AuthImportBotAuthorizationRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // AuthAuthorizationClass
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
APIID | int | yes | Application identifier (see. App configuration) |
APIHash | string | yes | Application identifier hash (see. App configuration) |
BotAuthToken | string | yes | Bot token (see bots) |
Returns
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | ACCESS_TOKEN_EXPIRED | Access token expired. |
| 400 | ACCESS_TOKEN_INVALID | Access token invalid. |
| 400 | API_ID_INVALID | API ID invalid. |
| 400 | API_ID_PUBLISHED_FLOOD | This API id was published somewhere, you can't use it now. |
References
- Official documentation
- Generated Go reference
- TL definition:
auth.importBotAuthorization#67a3ff2c