How to Create a Moderation Bot for Discord

Answer: A good Discord moderation bot combines basic commands (warn/mute/kick/ban), automated filtering (spam, links, slurs), and transparent logging. The fastest way to build one is to define your rules in plain English, preview required permissions, deploy, then test in a private mod channel before rolling it out.
TL;DR
- Start with a minimal rule set: spam + links + repeat messages.
- Always log actions to a mod-log channel with who/why/when.
- Use timeboxed punishments (timeouts) before permanent bans.
- Make moderation reversible: /unmute, /untimeout, /warn remove.
- Test permissions + intents first to avoid “it deployed but doesn’t work”.
What a moderation bot should do (minimum set)
Moderation bots usually fail in two ways: they’re too weak (no automation, no logs), or too aggressive (false positives, bad UX). This minimum set covers most servers:
- Commands:
/warn,/warnings,/timeout,/kick,/ban,/unban. - Auto-mod rules: invite links, repeated messages, mention spam, suspicious new accounts.
- Logging: one channel that records every action (including automated ones).
- Appeals: a single path to appeal (ticket, form, or DM command).
Step 1: Create your moderation channels
- #mod-log — read-only for mods; the bot posts structured logs.
- #mod-commands — where mods run bot commands (keeps noise out of general chat).
If you’re missing basics, start with Discord security settings first, then add a bot.
Step 2: Define your rules (keep them explicit)
Write rules like a checklist so the bot can implement them predictably:
- Spam: 6+ messages in 10 seconds → delete + warn
- Invite links: delete + warn (except whitelisted channels)
- Mention spam: 5+ mentions in one message → timeout 10 minutes
- New account: account age < 7 days → require verification
Prompt template (copy/paste)
Build a Discord moderation bot with:
- Commands: /warn, /warnings, /timeout, /kick, /ban, /unban
- Auto-mod rules:
- Delete invite links outside #links (warn once, then timeout 10m on repeat)
- Delete spam bursts (6+ messages in 10s) and warn
- Timeout mention spam (5+ mentions) for 10m
- Logging:
- Post all actions to #mod-log with user, moderator (or "auto"), reason, duration
- Safety:
- Ignore admins/mods
- Whitelist #memes for links
- Rate limit bot responses to avoid spam
Troubleshooting
- If moderation commands fail, it’s usually role hierarchy or missing permissions — see permissions errors.
- If the bot is flaky after deploy, use the testing checklist to confirm it’s really working.
FAQ
Should I ban instantly or timeout first?
Timeout first for most cases. It reduces false positives and lets humans review. Reserve bans for repeated abuse, raids, and clearly malicious accounts.
Where do I put mod logs?
Use a dedicated read-only channel. Make it searchable and consistent so you can audit decisions later.
Build your moderation bot
Want a moderation bot tailored to your rules? Build a custom Discord bot with VibeCord and deploy it in minutes.
Ready to build your own bot?
Stop reading, start building. Create your first Discord bot in minutes—no code required.
Get Started Free