<?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: yuax</title>
    <description>The latest articles on DEV Community by yuax (@yuaxx).</description>
    <link>https://dev.to/yuaxx</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3948329%2F9309baac-4d66-4fd7-9aea-188a41a02fcb.jpeg</url>
      <title>DEV Community: yuax</title>
      <link>https://dev.to/yuaxx</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yuaxx"/>
    <language>en</language>
    <item>
      <title>How I Detect Discord Selfbots Without Reading a Single Message</title>
      <dc:creator>yuax</dc:creator>
      <pubDate>Sat, 23 May 2026 22:49:03 +0000</pubDate>
      <link>https://dev.to/yuaxx/how-i-detect-discord-selfbots-without-reading-a-single-message-1k31</link>
      <guid>https://dev.to/yuaxx/how-i-detect-discord-selfbots-without-reading-a-single-message-1k31</guid>
      <description>&lt;h3&gt;
  
  
  The Problem
&lt;/h3&gt;

&lt;p&gt;Discord selfbots - automated user accounts - are used for spam raids, phishing, and coordinated attacks. Traditional moderation bots scan message content, but that requires the MESSAGE_CONTENT privileged intent and raises privacy concerns.&lt;/p&gt;

&lt;p&gt;I wanted to catch bots without reading what people type.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Insight
&lt;/h3&gt;

&lt;p&gt;Discord's gateway broadcasts a &lt;code&gt;TYPING_START&lt;/code&gt; event every time someone begins typing. This is metadata - it tells you WHO started typing, WHERE, and WHEN.&lt;/p&gt;

&lt;p&gt;A human needs 300-500ms just to switch focus between two Discord channels. A selfbot fires parallel HTTP requests and can trigger typing in multiple channels within 5-50ms.&lt;/p&gt;

&lt;p&gt;That gap is massive. A hard threshold of 150ms catches every bot without touching a single real user.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  Selfbot           Human
  ┌─────┐          ┌─────────────────┐
  │5-50ms│          │   300-500ms+    │
  └─────┘          └─────────────────┘
       ▲                    ▲
       │                    │
   CAUGHT              SAFE
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Beyond Typing: Ghost Detection
&lt;/h3&gt;

&lt;p&gt;Some selfbots disable typing events entirely (using "silent typing" plugins). So I added the inverse detection:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If a message arrives WITHOUT a preceding TYPING_START - that's suspicious.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Normal Discord desktop clients always fire a typing event before sending. No typing + message = likely automation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Channel Sequence Fingerprinting
&lt;/h3&gt;

&lt;p&gt;Selfbots often iterate channels programmatically - by ID order (ascending or descending). Humans jump between channels randomly based on interest.&lt;/p&gt;

&lt;p&gt;If I see typing events hitting channels in perfect numeric ID order - that's a bot fingerprint.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Stack
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Rust&lt;/strong&gt; - lock-free DashMap correlator, sub-millisecond detection&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Twilight&lt;/strong&gt; - lightweight Discord gateway library (not discord.js)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SQLite&lt;/strong&gt; - persistent detection history, incident timeline&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zero privileged intents&lt;/strong&gt; - no MESSAGE_CONTENT, no GUILD_MEMBERS, no PRESENCE&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What It Cannot Do
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Read messages (by design)&lt;/li&gt;
&lt;li&gt;Catch 100% of threats (behavioral signals are probabilistic)&lt;/li&gt;
&lt;li&gt;Replace Discord AutoMod (it complements it - AutoMod for content, Wiretrip for behavior)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Try It
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://wiretrip.lol" rel="noopener noreferrer"&gt;https://wiretrip.lol&lt;/a&gt; - free, safe defaults (log-only mode), 30-second setup.&lt;/p&gt;

</description>
      <category>rust</category>
      <category>discord</category>
      <category>security</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
