bots.setBotCommands
Set bot command list
func (c *Client) BotsSetBotCommands(ctx context.Context, request *BotsSetBotCommandsRequest) (bool, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.BotsSetBotCommands(ctx, &tg.BotsSetBotCommandsRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // bool
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
Scope | BotCommandScopeClass | yes | Command scope |
LangCode | string | yes | Language code |
Commands | []BotCommand | yes | Bot commands |
Returns
bool
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | BOT_COMMAND_DESCRIPTION_INVALID | The specified command description is invalid. |
| 400 | BOT_COMMAND_INVALID | The specified command is invalid. |
| 400 | LANG_CODE_INVALID | The specified language code is invalid. |
| 400 | PEER_ID_INVALID | The provided peer id is invalid. |
| 400 | USER_BOT_REQUIRED | This method can only be called by a bot. |
| 400 | USER_ID_INVALID | The provided user ID is invalid. |
References
- Official documentation
- Generated Go reference
- TL definition:
bots.setBotCommands#517165a