Skip to main content

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

NameTypeRequiredDescription
ScopeBotCommandScopeClassyesCommand scope
LangCodestringyesLanguage code
Commands[]BotCommandyesBot commands

Returns

bool

Possible errors

CodeTypeDescription
400BOT_COMMAND_DESCRIPTION_INVALIDThe specified command description is invalid.
400BOT_COMMAND_INVALIDThe specified command is invalid.
400LANG_CODE_INVALIDThe specified language code is invalid.
400PEER_ID_INVALIDThe provided peer id is invalid.
400USER_BOT_REQUIREDThis method can only be called by a bot.
400USER_ID_INVALIDThe provided user ID is invalid.

References