# A Discord auto-mod bot with AI

> Remove invite links, blocked words, spam and abuse on their own. AI reads each message, every removal is logged to a mod channel, and three strikes in a day is a timeout.

Source: https://buildcord.dev/templates/automod/
Updated: 2026-11-05
Publisher: Buildcord (https://buildcord.dev)

Every new message is checked. Invites to other servers and words you block are removed at once. Anything else of a few words is read by AI, which removes spam, scams and harassment when it's sure. Each removal is a strike, logged in #mod-log, and three strikes in a day times the member out for an hour.

Plan: Paid. Checking every message means reacting to server events, which needs a bot that stays connected to Discord, on the Paid plan.
Add it to a server: https://app.buildcord.dev/templates/automod

## What it does

1. A member sends a message.
2. If it has a server invite or one of your blocked words, it's flagged. Otherwise AI decides whether it's fine, spam or abuse, and only a confident call counts.
3. Members who can manage messages are left alone. For anyone else the message is deleted and a strike is recorded.
4. The bot posts the details in #mod-log, and a short note in the channel that removes itself after 15 seconds.
5. A third strike within 24 hours times the member out for an hour.

## Commands

- `/automod words`: Sets the words that get a message removed, or shows them. Needs the Manage Server permission.
- `/automod strikes`: Shows a member's strikes from the last 30 days. Needs the Moderate Members permission.
- `/automod forgive`: Clears a member's strikes.

## Before you add it

- A channel named mod-log that only moderators can see.
- The Message Content intent turned on for your application in the Discord Developer Portal.
- The bot's role placed above the members it might time out.

## What you can change

- Edit the AI step's options to say what your server allows, or add one, such as NSFW.
- Change how sure the AI has to be in the comparison after it.
- Change three strikes and one hour, or add a kick.
- Allow invites to your own server by checking for its link first.

## Questions

### Does the AI read every message?

Every message of six characters or more that isn't already caught as an invite or a blocked word. Shorter ones, such as “ok”, are skipped. Delete the AI step and the bot is a plain rules filter.

### What if the AI gets it wrong?

It only acts when it's at least 80% sure, moderators are never touched, and every removal is logged with the message's text so you can check it. /automod forgive clears a member's strikes.

Step-by-step guide: [How to set up auto-moderation on Discord with AI](https://buildcord.dev/guides/discord-ai-automod/)
