account.updateConnectedBot
Connect a business bot » to the current account, or to change the current connection settings.
func (c *Client) AccountUpdateConnectedBot(ctx context.Context, request *AccountUpdateConnectedBotRequest) (UpdatesClass, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.AccountUpdateConnectedBot(ctx, &tg.AccountUpdateConnectedBotRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // UpdatesClass
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
Deleted | bool | — | Whether to fully disconnect the bot from the current account. |
Rights | BusinessBotRights | — | Business bot rights. |
Bot | InputUserClass | yes | The bot to connect or disconnect |
Recipients | InputBusinessBotRecipients | yes | Configuration for the business connection |
Returns
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | BOT_BUSINESS_MISSING | The specified bot is not a business bot (the user.bot_business flag is not set). |
| 400 | BUSINESS_RECIPIENTS_EMPTY | You didn't set any flag in inputBusinessBotRecipients, thus the bot cannot work with any peer. |
| 403 | PREMIUM_ACCOUNT_REQUIRED | A premium account is required to execute this action. |
References
- Official documentation
- Generated Go reference
- TL definition:
account.updateConnectedBot#66a08c7e