Skip to main content

bots.toggleUsername

Activate or deactivate a purchased fragment.com username associated to a bot we own.

func (c *Client) BotsToggleUsername(ctx context.Context, request *BotsToggleUsernameRequest) (bool, error)

Calling this method

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

res, err := api.BotsToggleUsername(ctx, &tg.BotsToggleUsernameRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // bool
return nil
})

Parameters

NameTypeRequiredDescription
BotInputUserClassyesThe bot
UsernamestringyesUsername
ActiveboolyesWhether to activate or deactivate it

Returns

bool

Possible errors

CodeTypeDescription
400BOT_INVALIDThis is not a valid bot.
400USERNAME_NOT_MODIFIEDThe username was not modified.

References