setMyCommands#

Returns: bool

class aiogram.methods.set_my_commands.SetMyCommands(*, commands: List[aiogram.types.bot_command.BotCommand], scope: Optional[aiogram.types.bot_command_scope.BotCommandScope] = None, language_code: Optional[str] = None, **extra_data: Any)[source]#

Use this method to change the list of the bot’s commands. See https://core.telegram.org/bots#commands <https://core.telegram.org/bots#commands>`_`https://core.telegram.org/bots#commands for more details about bot commands. Returns True on success.

Source: https://core.telegram.org/bots/api#setmycommands

commands: List[aiogram.types.bot_command.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.

scope: Optional[aiogram.types.bot_command_scope.BotCommandScope]#

A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to aiogram.types.bot_command_scope_default.BotCommandScopeDefault.

language_code: Optional[str]#

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

build_request(bot: Bot) Request[source]#

Usage#

As bot method#

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

Method as object#

Imports:

  • from aiogram.methods.set_my_commands import SetMyCommands

  • alias: from aiogram.methods import SetMyCommands

With specific bot#

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

As reply into Webhook in handler#

return SetMyCommands(...)