AI • Science • Technology • Future

Side Projects

Teaching a Discord Moderation Bot to Tell a Joke from an Insult

Image from the original article
Featured image: original publisher image. Via original publisher.

A Discord moderation bot has been designed to understand the intent behind messages—distinguishing between a joke and a genuine insult. Source: dev.to.

Problem with Traditional Filters

Discord’s default moderation uses word filters. These often fail: friends joking with each other get flagged, and cruel messages without swear words slip through.

How the Bot Works

The bot, called AI Automod, evaluates each message with a short, structured response. Each enabled module is assigned a number in the prompt.

  • If there’s a problem, it adds a category, severity (1–3), and tone (H for banter, S for serious).
  • For example, 32;H means a clear insult but a joke.

Responses are kept brief to ensure speed and low cost. A strict regex filter rejects any longer outputs.

Sensitivity and Server Settings

The prompt is identical across all servers and can be cached. Sensitivity is applied locally by the bot, not by the model.

  • Each server adjusts which severities count.
  • For banter, the bot applies one level less severity.
  • Changing settings doesn’t require a new API call.

Training with Real Examples

Early versions of the prompt caused the model to respond with 0 to almost everything.

Fixing this involved presenting examples as real user/assistant exchanges. The order of examples matters—the last one has the most influence.

Context Use and Tone Rules

The model sees the author’s previous messages and the message being replied to.

Image from the original article
original publisher image. Via original publisher. · Source

But it must not mislabel an innocent what?? as offensive. This rule is written into the prompt and supported by examples.

Second Opinion Before Action

Before any sanction, a stronger model is asked: Does this message contain the issue?

If the stronger model says no or doesn’t respond, the action is canceled. This follows a key principle: it’s better to miss a culprit than punish an innocent.

Learning from Mistakes

Staff can ‘pardon’ an automatic sanction. When this happens, the system records:

  • The message that was flagged.
  • What the model saw and responded with.
  • The server’s sensitivity settings.

These records are anonymized and reviewed before each prompt update to improve accuracy.

The bot is not a full AI assistant. It is a moderation tool built for speed, clarity, and accountability.

For more on AI moderation tools, see aiautomod.com. For a deeper look at how AI models interpret context, see Three AI Model Review Sites.

For a real-world example of user feedback shaping tech, see Offline Blackjack Trainer App.

Sources & further reading

Featured image: original publisher image. Via original publisher. Image source