ban_community_participant()

Client.ban_community_participant()

Ban or unban a participant in a community.

Usable by Users Bots
Parameters:
  • community_id (int | str) – The community channel.

  • participant_id (int | str) – The participant to ban or unban.

  • unban (bool, optional) – Pass True to unban. Defaults to False.

Returns:

bool – True on success.

Raises:

ChatAdminRequired – The user is not an admin of the community.

Example

await app.ban_community_participant(community_id, user_id)
await app.ban_community_participant(community_id, user_id, unban=True)