Skip to main content

account.disablePeerConnectedBot

Permanently disconnect a specific chat from all business bots » (equivalent to specifying it in recipients.exclude_users during initial configuration with account updateConnectedBot »); to reconnect of a chat disconnected using this method the user must reconnect the entire bot by invoking account.updateConnectedBot ».

func (c *Client) AccountDisablePeerConnectedBot(ctx context.Context, peer InputPeerClass) (bool, error)

Calling this method

client.Run(ctx, func(ctx context.Context) error {
api := client.API()

res, err := api.AccountDisablePeerConnectedBot(ctx, peer)
if err != nil {
return err
}
_ = res // bool
return nil
})

Parameters

NameTypeRequiredDescription
PeerInputPeerClassyesThe chat to disconnect

Returns

bool

Possible errors

CodeTypeDescription
400BOT_ALREADY_DISABLEDThe connected business bot was already disabled for the specified peer.
400BOT_NOT_CONNECTED_YETNo business bot is connected to the currently logged in user.
400PEER_ID_INVALIDThe provided peer id is invalid.

References