Skip to main content

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

NameTypeRequiredDescription
ScopeBotCommandScopeClassyesCommand scope
LangCodestringyesLanguage code

Returns

[]BotCommand

Possible errors

CodeTypeDescription
400USER_BOT_REQUIREDThis method can only be called by a bot.

References