Layer 220
method Bots
bots.setBotCommands#517165a scope:BotCommandScope lang_code:string commands:Vector<BotCommand> = Bool;

Parameters

Name Type Description
Scope BotCommandScope Command scope
LangCode string Language code
Commands Vector<BotCommand> 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.

Gogram Example

// BotsSetBotCommands - positional arguments
result, err := client.BotsSetBotCommands(&tg.BotCommandScope{}, "...", []tg.BotCommand{&tg.BotCommand{}})
if err != nil {
    // handle error
}
// result is *tg.Bool