Skip to main content

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​

NameTypeRequiredDescription
Deletedbool—Whether to fully disconnect the bot from the current account.
RightsBusinessBotRights—Business bot rights.
BotInputUserClassyesThe bot to connect or disconnect
RecipientsInputBusinessBotRecipientsyesConfiguration for the business connection

Returns​

UpdatesClass

Possible errors​

CodeTypeDescription
400BOT_BUSINESS_MISSINGThe specified bot is not a business bot (the user.bot_business flag is not set).
400BUSINESS_RECIPIENTS_EMPTYYou didn't set any flag in inputBusinessBotRecipients, thus the bot cannot work with any peer.
403PREMIUM_ACCOUNT_REQUIREDA premium account is required to execute this action.

References​