ban_chat_sender_chat()

async Client.ban_chat_sender_chat()

Ban a channel chat from sending messages in a supergroup or channel.

Use this to prevent a channel (acting as a sender) from posting in your chat. You must be an administrator with the appropriate admin rights.

Usable by Users Bots
Parameters:
  • chat_id (int | str) – Unique identifier (int) or username (str) of the target supergroup or channel where the sender chat should be banned.

  • sender_chat_id (int | str) – Unique identifier (int) or username (str) of the channel chat to ban.

Returns:

bool – True on success.

Example

# Ban a channel from sending in a supergroup
await app.ban_chat_sender_chat(chat_id, sender_chat_id)