aiogram/aiogram/methods/unban_chat_sender_chat.py
Alex Root Junior 9ec689b562
[3.x] Bot API 5.5 (#777)
* Re-generate API, cover changes

* Added patchnotes
2021-12-12 17:21:01 +02:00

28 lines
958 B
Python

from __future__ import annotations
from typing import TYPE_CHECKING, Any, Dict, Union
from .base import Request, TelegramMethod
if TYPE_CHECKING:
from ..client.bot import Bot
class UnbanChatSenderChat(TelegramMethod[bool]):
"""
Use this method to unban a previously banned channel chat in a supergroup or channel. The bot must be an administrator for this to work and must have the appropriate administrator rights. Returns :code:`True` on success.
Source: https://core.telegram.org/bots/api#unbanchatsenderchat
"""
__returning__ = bool
chat_id: Union[int, str]
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
sender_chat_id: int
"""Unique identifier of the target sender chat"""
def build_request(self, bot: Bot) -> Request:
data: Dict[str, Any] = self.dict()
return Request(method="unbanChatSenderChat", data=data)