# How to set up a warning system in Discord

> Give moderators a /warn command that keeps count, times members out at three warnings and bans at five. A free Discord moderation template, no code.

Source: https://buildcord.dev/guides/discord-warning-system/
Updated: 2026-11-05
Publisher: Buildcord (https://buildcord.dev)

A warning system lets moderators record a reason each time a member breaks a rule, and steps in on its own when the warnings add up. The warnings template gives you /warn, /warnings and /clearwarnings, keeps every warning in a collection, times a member out for an hour at three and bans at five. It runs on slash commands, so it is free.

## Steps

1. **Start from the warnings template.** Open the warnings template in Buildcord. It makes a bot with the three commands and the warnings collection already set up.
2. **Connect and deploy.** Paste your Discord application's token, add the bot to your server with its invite link and deploy.
3. **Put the bot's role high enough.** A bot can only time out or ban members whose roles are below its own. Drag the bot's role above the roles of the members it might act on.
4. **Warn someone.** Run `/warn` on a test member with a reason. The bot saves the warning and replies with how many they have. Only members with the Moderate Members permission can use it.
5. **Tune the numbers.** Open the warn flow and change the counts in its **Switch** step: a longer timeout, a kick at four, or a ban sooner.

## Good to know

- Every warning is a row in the warnings collection, with who, why, who gave it and when. Read and edit it on the bot's Data page.
- `/warnings` shows a member's count and their latest warning, only to the moderator who asked.
- Add a step that posts each warning in a log channel, or sends the member a private message with the reason.

## Questions

### Can warnings expire?

Not as the template comes. Count only recent rows to let old warnings lapse, with a Date and time step that works out a month back.

### Who can warn members?

Members with Discord's Moderate Members permission. The permission check is a step in the flow, so you can change it to a role.

## Build it

Start from the [Warnings template](https://buildcord.dev/templates/warnings/), with every flow already drawn. Use the warnings template: https://buildcord.dev/templates/warnings/
