mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-11 18:01:04 +00:00
1.1 KiB
1.1 KiB
setMyCommands
Description
Use this method to change the list of the bot's commands. Returns True on success.
Arguments
| Name | Type | Description |
|---|---|---|
commands |
#!python3 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: #!python3 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 SetMyCommandsfrom aiogram.api.methods import SetMyCommandsfrom 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(...)