A Discord warnings bot that times out and bans

Moderators warn members with /warn and a reason. The bot keeps every warning in a collection, counts a member's warnings each time, and steps in on its own: a one-hour timeout at three, a ban at five. It runs on slash commands, so it works on the Free plan.

Add to my serverRuns on the Free plan

What it does

  1. A moderator runs /warn on a member, with a reason.
  2. The bot adds the warning to its warnings collection and counts that member's warnings.
  3. At three, it times them out for an hour. At five, it bans them.
  4. Otherwise it replies with how many they have now.

Commands

  • /warn

    Warns a member with a reason, and says how many warnings they have. Needs the Moderate Members permission.

  • /warnings

    Shows how many warnings a member has, and the latest, privately.

  • /clearwarnings

    Forgets a member's warnings.

Before you add it

  • The bot's role placed above the roles of the members it might time out or ban.

How adding it works

Press Add to my server and Buildcord asks you to sign up or sign in. It then makes a new bot from this template, with every flow already drawn. Paste your Discord bot token, add the bot to your server with the invite link and deploy. Nothing is final: the template is an ordinary bot you can open and change.

What you can change

  • Change the numbers in the Switch step, or add a case for a kick.
  • Make the timeout longer, or have it grow with each warning.
  • Send the member a direct message with the reason.
  • Post each warning in a log channel too.

Questions

Where are the warnings kept?

In a collection called warnings, one row per warning with who, why, who gave it and when. You can read and edit it on the bot's Data page.

Do warnings ever expire?

Not as it comes. To let old ones lapse, count only recent rows: add “and at > {temp.since}” to the count's where, with a Date and time step working out {temp.since} a month back.

More templates

Draw the first flow.

A command, a reply and a deploy is a working bot. It takes a few minutes.

Start buildingOpen dashboard