banChatSenderChat#

Returns: bool

class aiogram.methods.ban_chat_sender_chat.BanChatSenderChat(*, chat_id: Union[int, str], sender_chat_id: int, **extra_data: Any)[source]#

Use this method to ban a channel chat in a supergroup or a channel. Until the chat is unbanned, the owner of the banned chat won’t be able to send messages on behalf of any of their channels. The bot must be an administrator in the supergroup or channel for this to work and must have the appropriate administrator rights. Returns True on success.

Source: https://core.telegram.org/bots/api#banchatsenderchat

chat_id: Union[int, str]#

Unique identifier for the target chat or username of the target channel (in the format @channelusername)

sender_chat_id: int#

Unique identifier of the target sender chat

build_request(bot: Bot) Request[source]#

Usage#

As bot method#

result: bool = await bot.ban_chat_sender_chat(...)

Method as object#

Imports:

  • from aiogram.methods.ban_chat_sender_chat import BanChatSenderChat

  • alias: from aiogram.methods import BanChatSenderChat

With specific bot#

result: bool = await bot(BanChatSenderChat(...))

As reply into Webhook in handler#

return BanChatSenderChat(...)