ban_community_participant()

async Client.ban_community_participant()

Ban or unban a participant from an entire community.

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

  • user_id (int | str) – Target user ID or username to ban/unban.

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

Returns:

bool – True on success.

Example

# Ban user
await app.ban_community_participant(community_id, user_id)

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