Skip to content

Moderation Commands

Comprehensive moderation tools for server management and maintaining order in your Discord server.

Quick Reference

Command Description Permission Required
&lock [role] [channel] Lock a channel for a specific role Manage Roles
&unlock [role] [channel] Unlock a channel for a specific role Manage Roles
&hide [role] [channel] Hide a channel from a specific role Manage Roles
&unhide [role] [channel] Unhide a channel from a specific role Manage Roles
&clear [amount] [target] Delete messages in bulk Manage Messages
&kick <member> [reason] Kick a member from the server Kick Members
&ban <member> [reason] Ban a member from the server Ban Members
&unban <user> [reason] Unban a member from the server Ban Members

Overview

Spruce Bot's moderation system provides:

  • Channel Management - Lock/unlock and hide/show channels
  • Message Management - Bulk message deletion and filtering
  • Member Management - Kick, ban, and unban members
  • Permission Controls - Advanced permission management
  • Audit Logging - Track all moderation actions

Best Practices

  • Always provide clear reasons for moderation actions
  • Use channel locking during discussions that need moderation
  • Test commands in a safe environment first
  • Keep role hierarchy in mind when using moderation commands

Channel Management

&lock

Lock a channel to prevent members from sending messages.

&lock [@role] [#channel]

Parameters: - role (optional) - Role to lock the channel for (default: @everyone) - channel (optional) - Channel to lock (default: current channel)

Examples:

&lock                           # Lock current channel for @everyone
&lock @Members                  # Lock current channel for @Members role
&lock @Members #general         # Lock #general for @Members role

Bot Permissions Required: - Manage Roles - Manage Channels

User Permissions Required: - Manage Roles

Usage Example

Locking a channel during an announcement:

&lock @Members #announcements

Bot Response:

🔒 Channel Locked
#announcements has been locked for @Members

&unlock

Unlock a previously locked channel.

&unlock [@role] [#channel]

Parameters: - role (optional) - Role to unlock the channel for (default: @everyone) - channel (optional) - Channel to unlock (default: current channel)

Examples:

&unlock                         # Unlock current channel for @everyone
&unlock @Members                # Unlock current channel for @Members
&unlock @Members #general       # Unlock #general for @Members

&hide

Hide a channel from a specific role's view.

&hide [@role] [#channel]

Parameters: - role (optional) - Role to hide the channel from (default: @everyone) - channel (optional) - Channel to hide (default: current channel)

Examples:

&hide @Members                  # Hide current channel from @Members
&hide @Members #staff-only      # Hide #staff-only from @Members

&unhide

Make a hidden channel visible to a specific role.

&unhide [@role] [#channel]

Parameters: - role (optional) - Role to show the channel to (default: @everyone) - channel (optional) - Channel to unhide (default: current channel)

Message Management

&clear

Delete messages in bulk from a channel.

&clear [amount] [@user]

Aliases: &purge

Parameters: - amount (optional) - Number of messages to delete (default: 10, max: 50) - user (optional) - Only delete messages from this user

Examples:

&clear                          # Delete 10 messages
&clear 25                       # Delete 25 messages
&clear 20 @spammer              # Delete 20 messages from @spammer

Bot Permissions Required: - Manage Messages - Read Message History

User Permissions Required: - Manage Messages

Limitations: - Maximum 50 messages per command - Cannot delete messages older than 14 days - Cannot delete pinned messages

Bulk Message Cleanup

Cleaning up spam:

&clear 30 @spammer

Bot Response:

🗑️ Messages Deleted
Successfully deleted 30 messages from @spammer

Member Management

&kick

Kick a member from the server.

&kick <@member> [reason]

Parameters: - member - Member to kick from the server - reason (optional) - Reason for the kick

Examples:

&kick @troublemaker             # Kick with no reason
&kick @spammer "Excessive spam" # Kick with reason

Bot Permissions Required: - Kick Members

User Permissions Required: - Kick Members

Safety Features: - Cannot kick members with higher roles - Cannot kick server owner - Logs action to audit log

&ban

Ban a member from the server.

&ban <@member> [reason]

Parameters: - member - Member to ban from the server - reason (optional) - Reason for the ban

Examples:

&ban @rulebreaker               # Ban with no reason
&ban @toxic "Harassment"        # Ban with reason

Bot Permissions Required: - Ban Members

User Permissions Required: - Ban Members

Features: - Deletes recent messages from banned user - Prevents user from rejoining - Logs action with reason

&unban

Unban a previously banned user.

&unban <user> [unban_all] [reason]

Parameters: - user - User ID or username to unban - unban_all (optional) - Set to True to unban all users (admin only) - reason (optional) - Reason for the unban

Examples:

&unban 123456789012345678       # Unban by user ID
&unban @username "Appeal accepted" # Unban with reason
&unban all True                 # Unban all banned users

Mass Unban

Using unban_all: True will unban up to 200 users at once. This action cannot be undone!

Advanced Features

Batch Operations

Lock multiple channels at once:

&lock category 123456789012345678 @Members

This will lock all channels in the specified category for the given role.

Permission Management

&clear_perms

Remove all permissions from roles.

&clear_perms [@role]

Parameters: - role (optional) - Specific role to clear permissions for

Examples:

&clear_perms @Muted             # Clear permissions for @Muted role
&clear_perms                    # Clear permissions for all roles below bot

User Permissions Required: - Manage Roles

Destructive Action

This command removes ALL permissions from the specified role(s). Use with extreme caution!

Troubleshooting

Common Issues

Error: "Missing permissions" or "Role hierarchy"

Solutions: - Ensure bot role is above target roles - Grant bot the required permissions - Check channel-specific permissions

Error: "Cannot delete messages older than 14 days"

Solution: Discord API limitation - use smaller batches or manual deletion

Error: Commands becoming slow or timing out

Solutions: - Wait between bulk operations - Use smaller batch sizes - Avoid rapid consecutive commands

Error Messages

Error Meaning Solution
"Role is higher than mine" Target role is above bot's role Move bot role higher in hierarchy
"Missing permissions" Bot lacks required permissions Grant necessary permissions
"Cannot kick/ban user" Target has higher permissions Only kick/ban users with lower roles
"Message too old" Message older than 14 days Cannot bulk delete old messages

Best Practices

Security Guidelines

  • Always provide reasons for moderation actions
  • Use least privilege - only grant necessary permissions
  • Test commands in private channels first
  • Document actions for transparency
  • Review regularly - check moderation logs

Workflow Recommendations

  1. Channel Management
  2. Use &lock during important announcements
  3. &hide sensitive channels from general members
  4. Unlock channels after discussions

  5. Message Cleanup

  6. Regular cleanup with &clear for active channels
  7. Target specific users for spam cleanup
  8. Use with moderation logs

  9. Member Management

  10. Start with warnings before kicks/bans
  11. Always provide clear reasons
  12. Consider temporary mutes before permanent bans

Support

Need help with moderation?


Next: Learn about Role Management Commands →