mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
[3.x] Bot API 5.3 + Improvements (#618)
* Regenerate API * Update code * Fixed command filter for photos * Fix tests so they are able to run * Test new and renamed API methods * Reformat files * Fix outer_middleware resolution (#637) (#640) * Fix outer_middleware resolution (#637) * Reformat files * Reorder routers when resolve middlewares Co-authored-by: Alex Root Junior <jroot.junior@gmail.com> * Added possibility to use empty callback data factory filter * Rename KeyboardConstructor to KeyboardBuilder * Fixed type Co-authored-by: evgfilim1 <evgfilim1@yandex.ru>
This commit is contained in:
parent
4599913e18
commit
ac2b0bb198
69 changed files with 1223 additions and 206 deletions
29
aiogram/methods/delete_my_commands.py
Normal file
29
aiogram/methods/delete_my_commands.py
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any, Dict, Optional
|
||||
|
||||
from ..types import BotCommandScope
|
||||
from .base import Request, TelegramMethod
|
||||
|
||||
if TYPE_CHECKING: # pragma: no cover
|
||||
from ..client.bot import Bot
|
||||
|
||||
|
||||
class DeleteMyCommands(TelegramMethod[bool]):
|
||||
"""
|
||||
Use this method to delete the list of the bot's commands for the given scope and user language. After deletion, `higher level commands <https://core.telegram.org/bots/api#determining-list-of-commands>`_ will be shown to affected users. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#deletemycommands
|
||||
"""
|
||||
|
||||
__returning__ = bool
|
||||
|
||||
scope: Optional[BotCommandScope] = None
|
||||
"""A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to :class:`aiogram.types.bot_command_scope_default.BotCommandScopeDefault`."""
|
||||
language_code: Optional[str] = None
|
||||
"""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"""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
||||
return Request(method="deleteMyCommands", data=data)
|
||||
Loading…
Add table
Add a link
Reference in a new issue