aiogram/aiogram/methods/set_my_commands.py
Alex Root Junior 915c84c742 Update API
2021-01-24 20:54:38 +02:00

27 lines
794 B
Python

from __future__ import annotations
from typing import TYPE_CHECKING, Any, Dict, List
from ..types import BotCommand
from .base import Request, TelegramMethod
if TYPE_CHECKING: # pragma: no cover
from ..client.bot import Bot
class SetMyCommands(TelegramMethod[bool]):
"""
Use this method to change the list of the bot's commands. Returns :code:`True` on success.
Source: https://core.telegram.org/bots/api#setmycommands
"""
__returning__ = bool
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."""
def build_request(self, bot: Bot) -> Request:
data: Dict[str, Any] = self.dict()
return Request(method="setMyCommands", data=data)