<?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.us-east-2.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>Why we ditched Discord Embeds for Components V2 (and built a minimalist bot)</title>
      <dc:creator>yuax</dc:creator>
      <pubDate>Wed, 16 Sep 2026 23:02:19 +0000</pubDate>
      <link>https://dev.to/yuaxx/why-we-ditched-discord-embeds-for-components-v2-and-built-a-minimalist-bot-fb6</link>
      <guid>https://dev.to/yuaxx/why-we-ditched-discord-embeds-for-components-v2-and-built-a-minimalist-bot-fb6</guid>
      <description>&lt;p&gt;If you've used Discord in the past few years, you've probably noticed that almost every bot feels identical: giant colorful embeds, endless emojis, noisy confirmation messages, and clunky reaction-based menus.&lt;/p&gt;

&lt;p&gt;When building &lt;a href="https://ego.skin" rel="noopener noreferrer"&gt;ego&lt;/a&gt; — a curated social utility bot — we decided to take a completely different route: keep it minimal, understated, and built entirely around Discord Components V2.&lt;/p&gt;

&lt;p&gt;Here is why we moved away from classic embeds and how we structured the architecture.&lt;/p&gt;




&lt;h3&gt;
  
  
  The Problem with Traditional Embeds
&lt;/h3&gt;

&lt;p&gt;Classic Discord embeds were great in 2017, but today they have major UX flaws:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Visual noise: High-contrast colored sidebars draw unnecessary attention to trivial status messages.&lt;/li&gt;
&lt;li&gt;Screen real estate: A simple command response can take up half a phone screen.&lt;/li&gt;
&lt;li&gt;Impersonal feel: They look like automated marketing bots rather than natural platform utilities.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Discord markdown has evolved. Features like subtext, blockquotes, and native Components V2 (containers, sections, buttons, and separators) allow you to build interfaces that feel native to Discord's dark theme.&lt;/p&gt;

&lt;p&gt;Instead of big colorful banners with decorative emojis, clean status blocks like this look significantly better:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;ws: 16ms&lt;br&gt;
-# shard 0 · 14 guilds&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  Tech Stack Choices: Pragmatism Over Hype
&lt;/h3&gt;

&lt;p&gt;For ego's core architecture, we opted for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Runtime: Node.js 22 + TypeScript (ESM)&lt;/li&gt;
&lt;li&gt;Library: discord.js v14&lt;/li&gt;
&lt;li&gt;Database: SQLite with better-sqlite3 and drizzle-orm&lt;/li&gt;
&lt;li&gt;Cache / Hot-State: Optional Redis layer, falling back to in-memory&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Why SQLite + Drizzle?
&lt;/h4&gt;

&lt;p&gt;A lot of bot developers immediately spin up PostgreSQL or MongoDB. For a social utility bot handling local guild preferences, fast identity histories, and low-latency lookups, an embedded SQLite database running with WAL mode (Write-Ahead Logging) delivers sub-millisecond query times with zero networking overhead.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;userSnapshots&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;sqliteTable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;user_snapshots&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;id&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;primaryKey&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
  &lt;span class="na"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;user_id&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;notNull&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
  &lt;span class="na"&gt;username&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;username&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;notNull&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
  &lt;span class="na"&gt;avatarHash&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;avatar_hash&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
  &lt;span class="na"&gt;capturedAt&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;integer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;captured_at&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;mode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;timestamp&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nf"&gt;notNull&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;───&lt;/p&gt;

&lt;p&gt;Killer Feature: Frictionless Media Auto-Resolution&lt;/p&gt;

&lt;p&gt;One of the biggest pain points in modern Discord is broken video previews when someone pastes a link from Instagram, X (Twitter), or TikTok.&lt;/p&gt;

&lt;p&gt;Rather than making users run commands like /fixlink or paste alternative domains, ego listens passively for supported URLs:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Resolves the direct media source via backend streamers.&lt;/li&gt;
&lt;li&gt;Attaches the video/photo directly using native Discord message attachments.&lt;/li&gt;
&lt;li&gt;Suppresses the original broken embed using MessageFlags.SuppressEmbeds.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The result: users get instant playable video right in their feed without clutter or friction.&lt;/p&gt;

&lt;p&gt;───&lt;/p&gt;

&lt;p&gt;What We Learned&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Restraint is a feature: Removing information is harder than adding it, but users appreciate tools that don't shout for attention.&lt;/li&gt;
&lt;li&gt;Components V2 are the future of Discord UI: Separators, accessory thumbnails, and discreet button rows provide significantly better hierarchy than legacy embeds.&lt;/li&gt;
&lt;li&gt;Keep feature logic out of generic event files: Isolate features into dedicated modules with their own lifecycle hooks and services.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can check out the live project at ego.skin (&lt;a href="https://ego.skin" rel="noopener noreferrer"&gt;https://ego.skin&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;How are you approaching UI design in Discord applications in 2026? Are you still using embeds or transitioning to components? Let me know in the comments!&lt;/p&gt;

</description>
      <category>discord</category>
      <category>typescript</category>
      <category>webdev</category>
      <category>minimalistic</category>
    </item>
    <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>
