get_bot_commands()

Client.get_bot_commands()

Get the current list of the bot’s commands for the given scope and user language. Returns Array of BotCommand on success. If commands aren’t set, an empty list is returned.

The commands passed will overwrite any command set previously. This method can be used by the own bot only.

Usable by Users Bots
Parameters:
  • scope (BotCommandScope, optional) – An object describing the scope of users for which the commands are relevant. Defaults to BotCommandScopeDefault.

  • language_code (str, optional) – A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands.

Returns:

List of BotCommand – On success, the list of bot commands is returned.

Example

# Get commands
commands = await app.get_bot_commands()
print(commands)