setMyCommands

Description

Use this method to change the list of the bot's commands. Returns True on success.

Arguments

Name Type Description
commands List[BotCommand] A JSON-serialized list of bot commands to be set as the list of the bot's commands. At most 100 commands can be specified.

Response

Type: bool

Description: Returns True on success.

Usage

As bot method

result: bool = await bot.set_my_commands(...)

Method as object

Imports:

  • from aiogram.methods import SetMyCommands
  • from aiogram.api.methods import SetMyCommands
  • from aiogram.api.methods.set_my_commands import SetMyCommands

In handlers with current bot

result: bool = await SetMyCommands(...)

With specific bot

result: bool = await bot(SetMyCommands(...))

As reply into Webhook in handler

return SetMyCommands(...)