Member Removal & Bans
The moderation system allows authorized members to remove (ban/kick) users from communities and manage the list of removed members.Remove Members
Remove one or more members from a community. This can be a temporary or permanent ban, and optionally delete their recent messages. Method:communities.removeMembers
Request: RemoveMembers
Snowflake ID of the community
List of user IDs to remove from the community
Unix timestamp indicating when the ban expires. If set to 0 or omitted, the ban is permanent.
Unix timestamp indicating how far back to delete messages from the removed members. Messages sent after this timestamp will be deleted.
Optional reason for the removal/ban. This can be displayed in audit logs or to the removed user.
RemovedMembers
List of members that were successfully removed
RemovedMember Structure
Snowflake ID of the removed user
User object containing the user’s information
Unix timestamp when the ban expires (if temporary). Null/0 for permanent bans.
The reason provided for the removal
Get Removed Members
Retrieve the list of all banned/removed members in a community. Method:communities.getRemovedMembers
Request: GetRemovedMembers
Snowflake ID of the community
RemovedMembers
List of all removed/banned members, including their ban expiration times and reasons
- Displaying a ban list in moderation tools
- Checking if a specific user is banned
- Reviewing ban reasons and expiration times
- Auditing moderation actions
Unban Members
Remove bans and allow previously removed members to rejoin the community. Method:communities.unbanMembers
Request: UnbanMembers
Snowflake ID of the community
List of user IDs to unban
Permission Requirements
To use moderation actions, members must have theREMOVE_MEMBERS permission flag (value: 2048, or 1<<11). See Roles & Permissions for more details.
Members with the ADMINISTRATOR permission can always perform moderation actions.
Ban Types
Permanent Ban
- Set
untilto 0 or omit it - User cannot rejoin until manually unbanned
- Use for serious violations
Temporary Ban
- Set
untilto a future Unix timestamp - User automatically allowed to rejoin after expiration
- Useful for cooling-off periods or minor infractions
Kick (Immediate Removal)
- Remove user without adding to ban list
- Currently implemented as a ban with immediate unban
- User can rejoin immediately if they have an invite
Message Deletion
When removing members, you can optionally delete their recent messages usingdelete_messages_since:
- Provide a Unix timestamp
- All messages from the user sent after this timestamp will be deleted
- Useful for removing spam or offensive content
- Common options:
- Last 24 hours:
current_time - 86400 - Last 7 days:
current_time - 604800 - Don’t delete messages: omit the field
- Last 24 hours:
Best Practices
- Always provide a reason - Helps with accountability and appeals
- Use temporary bans - For first-time or minor offenses
- Review removed members - Regularly check the ban list for expired bans
- Communicate clearly - Let users know why they were removed
- Document guidelines - Have clear community rules that justify removals