ZMN Bot Documentation
Setup guides and configuration reference for every ZMN module — security, moderation, roles, leveling, and access control.
Quick Navigation
Moderation
Complete moderation system with commands, auto-mod, case management, and auto-revert
Overview
The Moderation module provides a comprehensive toolkit for server moderation. It combines slash commands for manual moderation, an auto-mod engine for automated message filtering, a case management system for tracking all actions, and an auto-revert scheduler for temporary punishments.
What's Included
- • 19 Moderation Commands — ban, kick, mute, timeout, warn, and more
- • 8 Auto-Mod Detectors — bad words, spam, invites, caps, links, and more
- • Case Management — track every action with auto-incrementing case IDs
- • Auto-Revert Scheduler — temporary bans, mutes, locks automatically revert
- • Escalation System — automatic punishment escalation based on warn count
- • Discord AutoMod Sync — syncs rules to Discord's native AutoMod
Moderation Commands
All moderation commands use a permission guard system. Users need either the configured allowedRoles, allowedUsers, or Discord permissions to use them.
User Punishment
/banSlash CommandBan a user from the server
/ban <user> [reason] [duration]/unbanSlash CommandUnban a previously banned user
/unban <user_id> [reason]/kickSlash CommandKick a user from the server
/kick <user> [reason]/muteSlash CommandMute a user (auto-creates Muted role)
/mute <user> [reason] [duration]/unmuteSlash CommandRemove mute from a user
/unmute <user> [reason]/timeoutSlash CommandDiscord native timeout (max 28 days)
/timeout <user> [reason] [duration]/untimeoutSlash CommandRemove timeout from a user
/untimeout <user> [reason]/warnSlash CommandIssue a warning (triggers escalation check)
/warn <user> [reason]/unwarnSlash CommandRemove a warning from a user
/unwarn <user> [reason]Channel Management
/lockSlash CommandLock a channel preventing messages
/lock [channel] [reason] [duration]/unlockSlash CommandUnlock a previously locked channel
/unlock [channel] [reason]/slowmodeSlash CommandSet slowmode delay in a channel
/slowmode <seconds> [channel] [duration]/clearSlash CommandBulk delete messages in a channel
/clear <amount> [user] [channel] [reason]Voice Moderation
/vmuteSlash CommandMute a user in voice channels
/vmute <user> [reason] [duration]/vunmuteSlash CommandRemove voice mute from a user
/vunmute <user> [reason]/vkickSlash CommandDisconnect a user from their voice channel
/vkick <user> [reason]/moveSlash CommandMove a user between voice channels
/move <user> <channel> [reason]User Management
/setnickSlash CommandChange a user's nickname
/setnick <user> [nickname]/caseSlash CommandView case summary or manage case status
/case <user> [action]Auto-Mod Engine
The auto-mod engine runs on every message sent in your server. It uses 8 configurable detectors to identify rule violations and automatically enforce actions. Only the first matching detector triggers per message to avoid double-punishment.
Bad Words
Matches message content against a custom word list and/or the built-in default list of ~50 profanity/slur words
Repeated Text
Detects repeated characters, words, lines, and excessive emoji usage
Discord Invites
Detects Discord invite links with options to allow own guild and specific invite codes
External Links
Domain blocklist/allowlist with URL shortener blocking and media embed options
Excessive Caps
Detects messages with excessive capitalization based on percentage threshold
Excessive Spoilers
Detects too many spoiler tags or excessive spoiler content length
Mass Mentions
Detects mass user and role mentions, with option to ban @everyone
Anti-Spam
Rate-based spam detection for messages, duplicates, links, attachments, and emoji
Default Blocked Words
The Bad Words detector includes a built-in list of approximately 50 English profanity and slur words. This list is intentionally conservative — it targets the most universally unwanted words while minimizing false positives.
fuck, shit, asshole, bitch, dick, ...nigger, faggot, retard, chink, ...porn, hentai, nude, cock, ...whore, cunt, stfu, wtf, ...Use Default List
toggleEnable the built-in blocked words list (enabled by default)
Custom Words
text[]Add your own words to supplement or replace the default list. Press Enter after each word.
Case Insensitive
toggleMatch words regardless of capitalization (enabled by default)
Match Whole Word
toggleOnly match complete words using word boundaries (disabled by default — substring matching is used)
Duration Format
Duration options in moderation commands accept a simple shorthand format. Combine units for exact durations.
Duration Units
sSeconds30s = 30smMinutes10m = 600shHours1h = 3600sdDays7d = 604800sExamples
10m10m — 10 minutes1h1h — 1 hour30s30s — 30 seconds1d12h1d12h — 1 day and 12 hours7d7d — 7 days2h30m2h30m — 2 hours and 30 minutesSupported Auto-Revert Actions
When a duration is provided, the action is automatically reverted when the time expires. For example, /mute @user 10m will unmute the user after 10 minutes.
Auto-Revert & Scheduler
Duration-based moderation actions automatically schedule a revert. When a moderator specifies a duration (e.g., /mute @user 10m), the bot schedules an auto-unmute for 10 minutes later.
1Command with Duration
Moderator runs a command with a duration option (e.g., /mute @user 10m). The action is applied immediately.
2Schedule Created
A ScheduledAction document is stored in MongoDB with the revert action (e.g., unmute) and fireAt timestamp.
3Periodic Sweep
The scheduler service runs a periodic sweep, finding all actions where fireAt has passed. It uses broadcastEval to execute on the correct shard.
4Auto-Revert Executed
The revert action runs (e.g., unmute), a companion "system" case is created, and the ScheduledAction document is removed.
Escalation System
The escalation system automatically escalates punishments based on a user's warn count. When a warn is issued, the system checks the user's total active warns against configured rules.
Example Escalation Rules
Escalation Rules
rules[]Define warn count thresholds and corresponding automatic actions. Each rule specifies a warn count, action type, and optional duration.
Case Management
Every moderation and security action creates a case with an auto-incrementing case ID. Cases track the full lifecycle of an action and can be managed from both Discord and the dashboard.
Case Fields
Auto-incrementing integerban, mute, kick, warn, timeout, ...command, automod, security, escalation, systemopen → reviewing → resolved → closedtrue/false (action still in effect)Status Lifecycle
Case Managers
Case managers can change case status from both the dashboard and the /case command. Permission is checked across both moderation and security modules:
- Moderation case managers:
moderation.master.caseManagerRoles+caseManagerUsers - Security case managers:
security.caseManagerRoles+caseManagerUsers - Guild owner: Always has case management access
Configuration
Master Settings
Whitelist Roles
rolesRoles exempt from all moderation actions
Whitelist Users
usersUsers exempt from all moderation actions
Alert Roles
rolesRoles that receive DM notifications for moderation events
Alert Users
usersUsers that receive DM notifications for moderation events
Case Manager Roles
rolesRoles that can manage case status
Case Manager Users
usersUsers that can manage case status
Admin Roles
rolesRoles treated as administrators for hierarchy checks
Moderator Roles
rolesRoles treated as moderators for permission checks
Per-Command Settings
Each of the 19 moderation commands can be individually configured:
Enabled
toggleTurn this command/detector on or off
Require Reason
toggleForce moderators to provide a reason
Log Channel
channelChannel for this command's log embeds
Allowed Roles
rolesRoles that can use this command (in addition to Discord permissions)
Allowed Users
usersUsers that can use this command
Disabled Channels
channelsChannels where this command/detector cannot be used
Disabled Roles
rolesRoles that cannot be targeted by this command / Roles exempt from this detector
Default Duration
numberDefault duration in seconds (for mute, timeout, vmute)
Auto-Revert
toggleAutomatically revert after default duration when no duration specified
Revert After
numberSeconds after which to auto-revert (when autoRevert is enabled)
Per-Event Settings (Auto-Mod)
Each of the 8 auto-mod detectors can be individually configured:
Enabled
toggleTurn this command/detector on or off
Action
selectWhat happens when triggered: delete, warn, mute, timeout, kick, or ban
Duration
numberDuration for the action (e.g., mute for 600 seconds)
Log Channel
channelChannel for this command's log embeds
Disabled Channels
channelsChannels where this command/detector cannot be used
Disabled Roles
rolesRoles that cannot be targeted by this command / Roles exempt from this detector
DM on Action
DM on Action
toggleSend a DM to the target user when a moderation action is applied
DM Message
textCustom message template. Placeholders: {action}, {server}, {reason}
You were {action} in {server} for: {reason}Log Embeds
All moderation commands send rich embeds to the configured log channel. These embeds are standardized with consistent formatting for easy scanning:
- • Emoji + Action Title: 🔨 Ban, 👢 Kick, 🔇 Mute, ⚠️ Warn, 🔒 Channel Locked, etc.
- • Color Coding: Red (ban), orange-red (kick), amber (mute/timeout), green (un-commands), yellow (warn), grey (channel ops), blue (setnick)
- • Thumbnail: Target user avatar (or moderator avatar for channel actions)
- • Fields: Target, Moderator, Duration, Auto-Revert, Reason, Channel
- • Footer:
GuildName • Case #ID - • Timestamp: When the action was taken
Ephemeral Replies
Moderators receive a compact embed as an ephemeral reply confirming the action. These use a simplified format: emoji + action name + target, with the case ID in the footer.
Discord AutoMod Sync
ZMN Bot can sync your moderation event settings to Discord's native AutoMod rules. This provides an additional layer of protection that works even if the bot is temporarily offline.
Synced Rules
- • Bad Words → Discord KEYWORD filter (uses customWords only)
- • Discord Invites → Discord KEYWORD filter (regex pattern)
- • Mass Mentions → Discord MENTION_SPAM filter
- • Excessive Caps → Discord KEYWORD filter (regex pattern)
Best Practices
✓ Recommended Setup
- • Start with auto-mod detectors set to delete action before escalating to warn/mute
- • Use requireReason: true for ban, kick, and mute commands
- • Configure case manager roles so your mod team can manage cases from the dashboard
- • Set up escalation rules to automatically handle repeat offenders
- • Use disabledChannels for bot commands channels where spam detection isn't needed
- • Enable DM on Action so users know why they were punished
- • Use duration options for temporary actions — auto-revert ensures nothing is forgotten
✗ Common Mistakes
- • Setting auto-mod action to ban for first offenses (too aggressive)
- • Not configuring whitelist roles (bot/moderator messages get flagged)
- • Forgetting to set a log channel (no visibility into actions)
- • Using permanent mutes/bans without duration when temporary action is intended
- • Not testing escalation rules before enabling (can lead to unexpected bans)
- • Adding too many custom words to badWords without matchWholeWord (causes false positives)
