Key Benefit: Enforce community guidelines by restricting access for users who violate rules, while maintaining the ability to reinstate users when appropriate.

Feature Overview

Ban Management provides the tools to restrict channel access for users who violate community guidelines or engage in disruptive behavior. Banned users lose access to the channel and cannot rejoin without being unbanned by a moderator.

Ban Members

Restrict channel access
  • Remove disruptive users
  • Enforce community guidelines
  • Prevent rejoining
  • Maintain channel safety

Unban Members

Restore channel access
  • Reinstate reformed users
  • Correct mistaken bans
  • Enable second chances
  • Manage user rehabilitation
Permanent Impact: Banned users cannot rejoin the channel until explicitly unbanned. Use ban functionality responsibly and consider temporary alternatives like muting for less severe violations.

Ban System Concepts

Understanding the ban system is essential for effective moderation:
ConceptDescriptionImpact
Channel BanUser blocked from specific channelCannot access channel content or participate
Ban StatusCurrent restriction stateActive ban prevents all channel interactions
Moderation RightsPermission to ban/unbanOnly moderators can manage bans
Ban HistoryRecord of banning actionsAudit trail for moderation decisions
Important Considerations:
  • Banned users are automatically removed from the channel
  • Bans persist until explicitly lifted by a moderator
  • Channel creators cannot be banned from their own channels
  • Consider documenting ban reasons for consistency

Implementation Guide

Restrict channel access for problematic usersRemove users from channels and prevent them from rejoining when they violate community guidelines or engage in disruptive behavior.

Core Operations

MethodPurposeWhen to Use
banMembersBan users from channelRemoving disruptive members
getBannedMembersList banned usersReviewing ban status

Code Examples

let channelModeration = AmityChannelModeration(client: client, andChannel: "<channel-id>")

// Ban channel members
do {
let success = try await channelModeration.banMembers(["<user-id>"])
} catch {
// Handle error here
}
Ban Validation: Always validate that the current user has moderation permissions and that the target user can be banned (not channel creator) before attempting ban operations.

Best Practices

Implementation Strategy: Start with basic ban/unban functionality, then add validation and confirmation flows. Implement comprehensive logging and audit capabilities for governance compliance. Consider integrating with your broader moderation and user management systems.