mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-12 10:11:52 +00:00
Add support of Bot API 4.7. Bump version
This commit is contained in:
parent
4cb9697cb4
commit
33003f2026
167 changed files with 996 additions and 504 deletions
57
docs/api/methods/set_my_commands.md
Normal file
57
docs/api/methods/set_my_commands.md
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
# 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
|
||||
|
||||
```python3
|
||||
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
|
||||
```python3
|
||||
result: bool = await SetMyCommands(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: bool = await bot(SetMyCommands(...))
|
||||
```
|
||||
#### As reply into Webhook in handler
|
||||
```python3
|
||||
return SetMyCommands(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#setmycommands)
|
||||
- [aiogram.types.BotCommand](../types/bot_command.md)
|
||||
Loading…
Add table
Add a link
Reference in a new issue