Moderation Commands

Updated 3/28/2026

At-a-glance

  • Command: /moderation <subcommand>

  • Default permission: Moderate Members (so staff/mods/managers typically run these).

  • There are subcommands to enable/disable the moderation feature, ban/unban/kick/mute/unmute, warn/list warnings, clear/purge messages, slowmode, lockdown/unlock, and modlog/setlog. Implementation uses standard Discord APIs and small helper logic (like parsing durations with ms).


Commands

Below each command: Purpose, Syntax / options, Example, Who can run it, and Notes / tips.


/moderation enable / /moderation disable

Purpose — Toggle whether moderation commands are active on the server (the bot writes a small JSON flag to disk).
Syntax

/moderation enable
/moderation disable

Example

/moderation enable

Who can run it — Moderators/admins.
Notes — When disabled the bot will politely reject moderation subcommands. The implementation stores the enabled flag on disk.


/moderation ban <user> [reason]

Purpose — Permanently ban a guild member.
Syntax

/moderation ban user:@member [reason:"text"]

Example

/moderation ban user:@ToxicUser reason:"Raid activity"

Who can run it — Moderators with permission to ban (and configured in Command Permissions).
Notes / tips

  • The bot calls guild.members.ban(member.id, { reason }). Ensure the bot has Ban Members permission and its role is above the target role. The command replies with a confirmation message.


/moderation unban <user_id>

Purpose — Unban a previously banned user by ID.
Syntax

/moderation unban userid:"123456789012345678"

Example

/moderation unban userid:"123456789012345678"

Who can run it — Moderators/admins.
Notes / tips — Supply the Discord user ID (string). The bot calls guild.members.unban(id) and confirms.


/moderation kick <user> [reason]

Purpose — Kick a user from the guild (remove without banning).
Syntax

/moderation kick user:@member [reason:"text"]

Example

/moderation kick user:@RuleBreaker reason:"Repeated spam"

Who can run it — Moderators.
Notes / tips — Uses member.kick(reason). Kicks do not block rejoining and are useful for one-off removals.


/moderation mute <user> [duration]

Purpose — Timeout a user (temporary mute) for the provided duration or indefinitely.
Syntax

/moderation mute user:@member [duration:"10m"|"1h"|"1d"]

Example

/moderation mute user:@Spammer duration:"30m"

Who can run it — Moderators.
Notes / tips

  • Duration accepts shorthand values (10s, 5m, 1h, etc.). The bot uses the ms library to parse string durations (ms("30m")) and passes milliseconds to the Discord timeout API. If duration is omitted the command times out with null (indefinite). The command validates duration and will respond with an error for invalid formats.


/moderation unmute <user>

Purpose — Remove a timeout and restore normal message privileges to a user.
Syntax

/moderation unmute user:@member

Example

/moderation unmute user:@Spammer

Who can run it — Moderators.
Notes / tips — Implemented by removing the timeout (member.timeout(null)).


/moderation warn <user> <reason>

Purpose — Issue a warning record for a user (keeps local memory of warnings).
Syntax

/moderation warn user:@member reason:"Exploit reported"

Example

/moderation warn user:@TroubleMaker reason:"Posting NSFW content"

Who can run it — Moderators.
Notes / tips — The simple implementation stores warnings in an in-memory JS object (persisted behavior may vary). Use /moderation warnings to list active warnings. The bot replies with the warning confirmation.


/moderation warnings <user>

Purpose — List active warnings for the user.
Syntax

/moderation warnings user:@member

Example

/moderation warnings user:@TroubleMaker

Who can run it — Moderators.
Notes / tips — The implementation enumerates the stored warnings and returns them in a short list. If no warnings are present the bot will note that.


/moderation clear <amount>

Purpose — Bulk-delete a number of recent messages from the current channel.
Syntax

/moderation clear amount:10

Example

/moderation clear amount:20

Who can run it — Moderators.
Notes / tips

  • The command uses channel.bulkDelete(amount, true). Discord’s bulk delete API cannot delete messages older than 14 days — attempting to do so will fail. The bot passes true to filter old messages, but staff should still be aware of the 14-day limit. The command replies with a count of deleted messages.


/moderation slowmode <duration>

Purpose — Set the per-user message slowmode on the current channel.
Syntax

/moderation slowmode duration:"10s" | "1m"

Example

/moderation slowmode duration:"30s"

Who can run it — Moderators.
Notes / tips — The implementation parses the duration to milliseconds, then calls channel.setRateLimitPerUser(seconds). The command validates the format and responds with an error for invalid values.


/moderation lockdown [duration] & /moderation unlock

Purpose — Lock the current channel by denying SendMessages for @everyone; unlock restores send permission. Optionally automatically unlock after the given duration.
Syntax

/moderation lockdown [duration:"10m"]
/moderation unlock

Example

/moderation lockdown duration:"10m"
/moderation unlock

Who can run it — Moderators.
Notes / tips — The bot updates channel permission overwrites for @everyone. If a duration is provided the bot sets a timeout to automatically re-open the channel later. Ensure the bot has Manage Channels and Manage Roles as appropriate.


/moderation purge <user> <amount>

Purpose — Delete a specific number of recent messages authored by a single user in the current channel.
Syntax

/moderation purge user:@member amount:10

Example

/moderation purge user:@Spammer amount:5

Who can run it — Moderators.
Notes / tips

  • The implementation fetches the last 100 messages then filters the given user and deletes the requested amount from those. This means the command deletes only from recent history (the last 100 messages fetched). If you need to remove older messages, additional tooling is required. Also consider the 14-day deletion limit for bulk delete calls.


/moderation modlog & /moderation setlog <channel>

Purpose — Quick mod-log utilities: modlog shows a summary of recent moderation actions (placeholder in the implementation) and setlog configures the channel used for moderation logs.
Syntax

/moderation modlog
/moderation setlog channel:#mod-logs

Example

/moderation setlog channel:#mod-logs
/moderation modlog

Who can run it — Moderators.
Notes / tips — In the current implementation modlog returns a placeholder message and setlog returns a placeholder confirmation — the commands are present and wired but further log-storage/viewing may be implemented via the dashboard or persistent audit services in the project. The moderation system integrates with dashboard audit/logging features in the broader control suite.


Automod, raidshield & advanced moderation

Beyond these manual commands, GR Rocket includes auto-moderation tooling:

  • /moderation automod — configure auto-moderation rule actions, thresholds, and logging destinations (example: /moderation automod rule:spam action:timeout threshold:3 duration:30m).

  • /moderation raidshield — raidshield posture controls (aggressive/lenient settings used during suspected raids).

These map to the Auto-mod matrix in the dashboard so staff can stage rules and tune thresholds before publishing. The automod commands are used to keep the server safe and are intended to mirror the dashboard’s auto-mod matrix.


Permissions required (bot & staff)

Bot permissions (common pitfalls)

  • Ban Members — for /moderation ban/unban.

  • Kick Members — for /moderation kick.

  • Moderate Members / Timeout Members — for mute/unmute (timeouts).

  • Manage Messages — for bulk delete / clear.

  • Manage Channels — for lockdown/unlock (editing channel overwrites).

  • Manage Roles — if moderation actions interact with role changes.

Staff permissions

  • The command builder sets Moderate Members as the default required permission — configure Command Permissions in the dashboard to allow Managers or custom roles to run these commands. If a staff user lacks the required Discord permission or is not granted via Command Permissions the command will be inaccessible.


Best practices & workflows

  • Enable moderation only when ready — use /moderation enable after verifying bot permissions and logging.

  • Use warnings first — when appropriate, warn users prior to timed punishments. Warnings are a lightweight record that helps escalation.

  • Generate audit/transcript — the project’s audit/logging services and ticket transcripts (when applicable) help preserve an evidence trail. Consider posting outcomes to a dedicated mod-log channel.

  • Staged automod configuration — use the dashboard to stage automod rules and test carefully, especially raidshield rules that may lock down the server.


Troubleshooting

  • “Moderation is disabled” — run /moderation enable. The bot checks a disk flag and will reject commands when disabled.

  • Action fails due to permissions — verify the bot role is above the target role and that the bot has the correct guild permissions (Ban/Kick/Manage Channels/Manage Messages).

  • Bulk delete errors — bulk deletes cannot remove messages older than 14 days. Use user purge with care (the built-in purge fetches only the last 100 messages).

  • Invalid duration — many moderation subcommands accept durations (mute/slowmode/lockdown). The bot validates format (like 10s, 5m, 1h) and will reply with an error for invalid values.


Quick cheatsheet

/moderation enable
/moderation disable
/moderation ban user:@member [reason:"..."]
/moderation unban userid:"123456789012345678"
/moderation kick user:@member [reason:"..."]
/moderation mute user:@member [duration:"30m"]
/moderation unmute user:@member
/moderation warn user:@member reason:"..."
/moderation warnings user:@member
/moderation clear amount:20
/moderation slowmode duration:"30s"
/moderation lockdown [duration:"10m"]
/moderation unlock
/moderation purge user:@member amount:10
/moderation modlog
/moderation setlog channel:#mod-logs