mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-12 10:11:52 +00:00
28 lines
958 B
Python
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)
|