mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-12 02:03:04 +00:00
* Base implementation * Bump license * Revert re-generated tests * Fix tests, improved docs * Remove TODO * Removed unreachable code * Changed type of `last_synchronization_error_date` * Fixed wrongly cleaned code
27 lines
1,021 B
Python
27 lines
1,021 B
Python
from __future__ import annotations
|
|
|
|
from typing import TYPE_CHECKING, Any, Dict, Optional
|
|
|
|
from ..types import ChatAdministratorRights
|
|
from .base import Request, TelegramMethod
|
|
|
|
if TYPE_CHECKING:
|
|
from ..client.bot import Bot
|
|
|
|
|
|
class GetMyDefaultAdministratorRights(TelegramMethod[ChatAdministratorRights]):
|
|
"""
|
|
Use this method to get the current default administrator rights of the bot. Returns :class:`aiogram.types.chat_administrator_rights.ChatAdministratorRights` on success.
|
|
|
|
Source: https://core.telegram.org/bots/api#getmydefaultadministratorrights
|
|
"""
|
|
|
|
__returning__ = ChatAdministratorRights
|
|
|
|
for_channels: Optional[bool] = None
|
|
"""Pass :code:`True` to get default administrator rights of the bot in channels. Otherwise, default administrator rights of the bot for groups and supergroups will be returned."""
|
|
|
|
def build_request(self, bot: Bot) -> Request:
|
|
data: Dict[str, Any] = self.dict()
|
|
|
|
return Request(method="getMyDefaultAdministratorRights", data=data)
|