Lesson 9 of 9 · 29m
Moderation Bot Patterns That Survive Real Communities
Build enforcement pipelines, appealable cases, raid controls, and audit evidence that moderators can trust under pressure.
The moderation bots that fail in production rarely fail because a regex was imperfect. They fail because the system cannot explain itself. A raid hits, the bot times out forty people, one innocent member is caught, the audit log is ambiguous, the appeal queue is chaos, and moderators lose trust. A good moderation bot is a case-management system with enforcement primitives attached, not a collection of keyword triggers.
Separate detection, decision, and action
A durable pipeline has explicit stages:
event intake -> feature extraction -> policy decision -> action execution -> evidence recordDetection can be noisy. Decision policy should know severity, confidence, account age, prior cases, exemptions, and guild configuration. Action execution should be rate-limit-aware, permission-aware, and idempotent. Evidence recording should happen even when the action fails.
A simplified policy decision might be:
{
action: "timeout", severity: "high", durationSeconds: 3600,
rule: "raid.join_velocity", confidence: 0.91, appealable: true
}That object is far more useful than a comment in a websocket handler saying "ban spammer."
Prefer reversible first responses
Under uncertainty, reversible controls beat permanent punishment. Timeout, quarantine role, slowmode, verification gate, or channel lock can reduce harm while preserving appeal options. Banning is sometimes correct, but automated permanent bans require high confidence and strong evidence.
Raid response often combines controls calibrated to normal community volume:
join velocity/account cluster -> pause invites, timeout or quarantine for review
message burst/confirmed abuse -> slowmode plus deletion, then ban after correlationDiscord's native AutoMod can block common spam, mention floods, and configured keywords before your bot sees content. Your bot still adds value through cross-channel correlation, account metadata, case workflow, custom escalation, and evidence. Let native controls absorb simple high-volume junk; reserve bot enforcement for decisions needing context.
Evidence must answer moderator questions
A useful case record answers:
who or what triggered the rule, and which policy version fired?
which message/user/account features were observed?
what action was attempted, and what did Discord return?
which prior cases, reviews, reversals, or edits shaped the outcome?Store message and user IDs, channel IDs, timestamps, action status, and limited excerpts where justified. Moderators need enough context to defend the decision. They do not need an uncontrolled plaintext archive of every message forever.
Human controls and degraded modes
Moderation interfaces should make the next safe action obvious. Show role hierarchy warnings, existing active cases, alt-account correlations where appropriate, and reversibility. Require explicit confirmation for mass actions. Record the human actor independently of the bot actor; "the bot banned them" is incomplete when a moderator clicked the button.
If the rules engine is down but gateway events continue, do not pretend enforcement is healthy. If the database is unavailable, decide which cached policies may continue and which actions must pause. Write incident state into the moderator-facing channel or dashboard. Silence is how communities discover trust erosion.
Field notes
- Never use message deletion as the only evidence preservation strategy. Deleted evidence is not evidence.
- Appeals need state transitions and ownership. A moderator note in Discord chat is not case management.
- Measure false positives as a first-class metric. A system moderators override constantly is training them to ignore it.
Was this lesson helpful?