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
| Name | Type | Required | Description |
|---|---|---|---|
Bot | InputUserClass | yes | The bot |
Username | string | yes | Username |
Active | bool | yes | Whether to activate or deactivate it |
Returns
bool
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | BOT_INVALID | This is not a valid bot. |
| 400 | USERNAME_NOT_MODIFIED | The username was not modified. |
References
- Official documentation
- Generated Go reference
- TL definition:
bots.toggleUsername#53ca973