<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: NotFromParis</title>
    <description>The latest articles on DEV Community by NotFromParis (@notfromparis_5e77f6479780).</description>
    <link>https://dev.to/notfromparis_5e77f6479780</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4257339%2F74df1460-310b-44e0-99a0-c575ab602734.jpg</url>
      <title>DEV Community: NotFromParis</title>
      <link>https://dev.to/notfromparis_5e77f6479780</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/notfromparis_5e77f6479780"/>
    <language>en</language>
    <item>
      <title>Teaching a Discord moderation bot to tell a joke from an insult</title>
      <dc:creator>NotFromParis</dc:creator>
      <pubDate>Sat, 21 Nov 2026 13:22:05 +0000</pubDate>
      <link>https://dev.to/notfromparis_5e77f6479780/teaching-a-discord-moderation-bot-to-tell-a-joke-from-an-insult-1efi</link>
      <guid>https://dev.to/notfromparis_5e77f6479780/teaching-a-discord-moderation-bot-to-tell-a-joke-from-an-insult-1efi</guid>
      <description>&lt;p&gt;Word filters are the default for Discord moderation, and they fail in both directions: friends roasting each other get punished, and a cruel message with no swear word goes through. I wanted a bot that judges what a message &lt;em&gt;means&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  One short answer per message
&lt;/h2&gt;

&lt;p&gt;Each enabled module gets a number in the prompt. The model answers in a few characters: &lt;code&gt;0&lt;/code&gt; if nothing is wrong, otherwise category + severity (1 to 3) + tone, &lt;code&gt;H&lt;/code&gt; for banter or &lt;code&gt;S&lt;/code&gt; for serious. &lt;code&gt;32;H&lt;/code&gt; means "a clear insult, but a joke". Short answers keep it fast and cheap, and a strict regex rejects anything else.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sensitivity is applied by the bot, not the model
&lt;/h2&gt;

&lt;p&gt;The prompt is identical for every server, so it can be cached. Each server's sensitivity only changes which severities count locally, and banter counts one level less. Changing a setting never needs another API call.&lt;/p&gt;

&lt;h2&gt;
  
  
  Few-shot examples as real turns
&lt;/h2&gt;

&lt;p&gt;Listing the examples inside the system prompt made the small model answer &lt;code&gt;0&lt;/code&gt; to almost everything. Sending them as real user/assistant exchanges fixed it. Their order matters too: the last example pulls the answer towards it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Context is for tone only
&lt;/h2&gt;

&lt;p&gt;The model sees the author's previous messages and the message being replied to, but an innocent "what??" under an insult must stay innocent. That rule is written into the prompt and backed by examples.&lt;/p&gt;

&lt;h2&gt;
  
  
  A second opinion before any sanction
&lt;/h2&gt;

&lt;p&gt;When the first model wants to act, a stronger model gets a yes/no question: does this message itself really contain it? If it says no, or doesn't answer, nothing happens. The rule: better to miss a culprit than punish an innocent.&lt;/p&gt;

&lt;h2&gt;
  
  
  Learning from mistakes
&lt;/h2&gt;

&lt;p&gt;Staff can "pardon" an automatic sanction. The pardoned message, what the model saw and answered, and the server's settings are kept (anonymised) and reviewed before each update to fix the prompt and the examples.&lt;/p&gt;




&lt;p&gt;The bot is &lt;a href="https://aiautomod.com" rel="noopener noreferrer"&gt;AI Automod&lt;/a&gt;. The rule-based moderation is free; I'm happy to answer questions about the prompt design in the comments.&lt;/p&gt;

</description>
      <category>discord</category>
      <category>ai</category>
      <category>python</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
