peyk.platforms.telegram.methods.ban_chat_sender_chat

async peyk.platforms.telegram.methods.ban_chat_sender_chat(self, chat_id: int | str, sender_chat_id: int) bool[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.

Parameters:
  • chat_id – Unique identifier for the target chat or username of the target channel in the format @username

  • sender_chat_id – Unique identifier of the target sender chat

Returns:

Result returned by Telegram on successful execution.

Return type:

bool