setMyCommands

Set the bot’s commands in the given scope and/or language. Bot-only.

Parameters

commands: BotCommand[]

The commands to set.

languageCode?: string

A two-letter ISO 639-1 language code. If not set, the command details will be updated for users having an unsupported language.

The scope in which the commands are available.

Result

void

Syntax

// Required parameters only.
await client.setMyCommands(commands);

// Required parameters + optional parameters.
// Any of the optional parameters can be omitted.
await client.setMyCommands(commands, { languageCode, scope });