bots.getBotCommands
Obtain a list of bot commands for the specified bot scope and language code
func (c *Client) BotsGetBotCommands(ctx context.Context, request *BotsGetBotCommandsRequest) ([]BotCommand, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.BotsGetBotCommands(ctx, &tg.BotsGetBotCommandsRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // []BotCommand
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
Scope | BotCommandScopeClass | yes | Command scope |
LangCode | string | yes | Language code |
Returns
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | USER_BOT_REQUIRED | This method can only be called by a bot. |
References
- Official documentation
- Generated Go reference
- TL definition:
bots.getBotCommands#e34c0dd6