<?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: fakejsdev</title>
    <description>The latest articles on DEV Community by fakejsdev (@fakejsdev).</description>
    <link>https://dev.to/fakejsdev</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%2F1780445%2Fd5ce402c-b5ab-4b41-b5d7-35d393fc6e70.png</url>
      <title>DEV Community: fakejsdev</title>
      <link>https://dev.to/fakejsdev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/fakejsdev"/>
    <language>en</language>
    <item>
      <title>I got tired of Discord.js boilerplate, so I built the "T3 App" for Discord Bots 🧩 (Powered by Bun)</title>
      <dc:creator>fakejsdev</dc:creator>
      <pubDate>Fri, 18 Sep 2026 20:37:29 +0000</pubDate>
      <link>https://dev.to/fakejsdev/i-got-tired-of-discordjs-boilerplate-so-i-built-the-t3-app-for-discord-bots-powered-by-bun-2nip</link>
      <guid>https://dev.to/fakejsdev/i-got-tired-of-discordjs-boilerplate-so-i-built-the-t3-app-for-discord-bots-powered-by-bun-2nip</guid>
      <description>&lt;p&gt;If you’ve ever built a Discord bot using &lt;strong&gt;Discord.js&lt;/strong&gt;, you know the struggle. The library is incredibly powerful, but it leaves architecture entirely up to you. &lt;/p&gt;

&lt;p&gt;Every time I started a new bot project, I found myself doing the exact same chores:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Setting up &lt;strong&gt;TypeScript&lt;/strong&gt; and a linter.&lt;/li&gt;
&lt;li&gt;Writing a custom &lt;strong&gt;command/event handler&lt;/strong&gt; from scratch.&lt;/li&gt;
&lt;li&gt;Fighting with &lt;code&gt;customId&lt;/code&gt; strings to pass data between commands and buttons.&lt;/li&gt;
&lt;li&gt;Setting up &lt;strong&gt;Prisma&lt;/strong&gt; and a &lt;strong&gt;Redis queue&lt;/strong&gt; when the bot finally needed to scale.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I realized I wanted the &lt;strong&gt;&lt;a href="https://create.t3.gg/" rel="noopener noreferrer"&gt;create-t3-app&lt;/a&gt; experience&lt;/strong&gt;, but for Discord bots. I wanted an interactive CLI that gives me a production-ready, type-safe architecture with opt-in features like a database or background jobs.&lt;/p&gt;

&lt;p&gt;So, I built &lt;strong&gt;djstoolkit&lt;/strong&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  What is djstoolkit? 🧩
&lt;/h3&gt;

&lt;p&gt;It’s a blazing-fast, strictly typed scaffolding CLI for Discord.js bots, built ground-up for &lt;strong&gt;&lt;a href="https://bun.sh" rel="noopener noreferrer"&gt;Bun&lt;/a&gt;&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;Instead of a monolithic template, it uses an &lt;strong&gt;"À La Carte"&lt;/strong&gt; system. Run one command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;bun create djstoolkit my-awesome-bot
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You are greeted with a prompt asking exactly what infrastructure you need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Need a database? Hit spacebar, and it sets up &lt;strong&gt;Prisma (PostgreSQL)&lt;/strong&gt; and a Docker Compose file.&lt;/li&gt;
&lt;li&gt;  Need delayed tasks? Hit spacebar, and it sets up &lt;strong&gt;BullMQ (Redis)&lt;/strong&gt; with a type-safe worker system.&lt;/li&gt;
&lt;li&gt;  Don't need them? Leave them unchecked, and you get a clean, barebones project without a single line of bloat.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F51jwlnu4kv79ryaqhm4m.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F51jwlnu4kv79ryaqhm4m.gif" alt="djstoolkit CLI Demo" width="800" height="473"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ Bun-native (instant startup, no Node.js required)&lt;/li&gt;
&lt;li&gt;✅ Type-safe stateful component routing (no more &lt;code&gt;customId&lt;/code&gt; string hacking)&lt;/li&gt;
&lt;li&gt;✅ Opt-in Prisma / BullMQ / Redis — nothing you don't ask for&lt;/li&gt;
&lt;li&gt;✅ Zero-config TypeScript + Biome (formatting/linting in milliseconds)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;How is this different from CommandKit or Sapphire?&lt;/strong&gt; CommandKit is a great meta-framework but stays Node.js-first and leaves DB/queue setup entirely to you. Sapphire is powerful but heavily OOP (everything is a class), which means more boilerplate. djstoolkit is Bun-native from the ground up, ships opt-in infra (Prisma/BullMQ) out of the box, and keeps the file-based &lt;code&gt;defineX&lt;/code&gt; handler style instead of classes — so the learning curve stays low while you still get strict type-safety.&lt;/p&gt;




&lt;h3&gt;
  
  
  The Features that make it different
&lt;/h3&gt;

&lt;p&gt;I didn't just want to create a file copier. I wanted to solve the biggest &lt;strong&gt;DX (Developer Experience)&lt;/strong&gt; issues in Discord.js.&lt;/p&gt;

&lt;h4&gt;
  
  
  1. Revolutionary Component Routing (Prefix:UUID)
&lt;/h4&gt;

&lt;p&gt;Passing data from a command to a button in standard D.js is painful. You either use temporary Collectors (which expire) or you shove data into the &lt;code&gt;customId&lt;/code&gt; like &lt;code&gt;"BAN_USER_12345"&lt;/code&gt;, forcing you to write messy &lt;code&gt;.startsWith()&lt;/code&gt; checks everywhere.&lt;/p&gt;

&lt;p&gt;In &lt;strong&gt;djstoolkit&lt;/strong&gt;, we built a &lt;strong&gt;stateful prefix router&lt;/strong&gt;. &lt;br&gt;
You set your button ID to &lt;code&gt;BAN_USER:12345&lt;/code&gt;. The framework intercepts the interaction, splits it by the colon, routes it to the &lt;code&gt;BAN_USER&lt;/code&gt; handler, and passes &lt;code&gt;12345&lt;/code&gt; securely as a session variable.&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;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;defineButton&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@/lib/helpers/defineButton&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;run&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;defineButton&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;customId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;BAN_USER&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Confirm Ban&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Executes the ban&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="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;interaction&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;sessionId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// sessionId is automatically extracted! (e.g. "12345")&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;interaction&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;guild&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;members&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ban&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;sessionId&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;interaction&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;reply&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;User banned!&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="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  2. Built-in Memory Store (With Auto-TTL)
&lt;/h4&gt;

&lt;p&gt;Combined with the router above, we ship an elegant &lt;strong&gt;In-Memory Store&lt;/strong&gt;. You can generate a UUID session, save a complex object to RAM with a 15-minute TTL, and pass that UUID to a Modal or a Button. When the user clicks the button, you retrieve the data using &lt;code&gt;takeStore(sessionId)&lt;/code&gt;, which automatically deletes it from RAM to prevent double-clicks or memory leaks.&lt;/p&gt;

&lt;h4&gt;
  
  
  3. 100% Type-Safety via Module Augmentation
&lt;/h4&gt;

&lt;p&gt;If you opt into the internal Event Bus (&lt;code&gt;Relay&lt;/code&gt;) or Background Jobs (&lt;code&gt;BullMQ&lt;/code&gt;), you get absolute type safety without importing massive central registries. &lt;/p&gt;

&lt;p&gt;Using TypeScript's &lt;strong&gt;Module Augmentation&lt;/strong&gt;, you define your jobs anywhere in your code, and the &lt;code&gt;enqueueJob&lt;/code&gt; function magically knows what payload to ask for:&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="c1"&gt;// Define it once&lt;/span&gt;
&lt;span class="kr"&gt;declare&lt;/span&gt; &lt;span class="kr"&gt;module&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@/lib/bullmq/jobs&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;JobRegistry&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;send-reminder&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="nl"&gt;channelId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;reminder&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// Full autocomplete and validation anywhere in your app!&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;enqueueJob&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;send-reminder&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;channelId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;123&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;reminder&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  4. Blazing Fast (Bun + Biome)
&lt;/h4&gt;

&lt;p&gt;The entire project runs on &lt;strong&gt;Bun&lt;/strong&gt;. It starts instantly. We also ditched ESLint/Prettier in favor of &lt;strong&gt;&lt;a href="https://biomejs.dev/" rel="noopener noreferrer"&gt;Biome&lt;/a&gt;&lt;/strong&gt;, meaning formatting and linting take milliseconds. &lt;/p&gt;




&lt;h3&gt;
  
  
  Try it out!
&lt;/h3&gt;

&lt;p&gt;The project is currently in Beta (&lt;code&gt;v0.3.x&lt;/code&gt;), and the core architecture is stable — the docs in &lt;code&gt;/docs&lt;/code&gt; cover everything you need to get started. If you're planning to build a new Discord bot this weekend, give it a spin!&lt;/p&gt;

&lt;p&gt;📦 &lt;strong&gt;NPM:&lt;/strong&gt; &lt;a href="https://www.npmjs.com/package/create-djstoolkit" rel="noopener noreferrer"&gt;create-djstoolkit&lt;/a&gt;&lt;br&gt;&lt;br&gt;
🐙 &lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/fakejsdev/djstoolkit" rel="noopener noreferrer"&gt;fakejsdev/djstoolkit&lt;/a&gt; &lt;em&gt;(Stars are greatly appreciated! ⭐)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I’m actively looking for feedback on the CLI flow and the routing patterns. If you have any ideas, drop a comment below or open an issue on GitHub. PRs are extremely welcome! &lt;/p&gt;

&lt;p&gt;Let me know what you think! 👇&lt;/p&gt;




&lt;p&gt;Tags: #discordjs #bun #typescript #showdev&lt;/p&gt;

</description>
      <category>discord</category>
      <category>bunjs</category>
      <category>typescript</category>
      <category>architecture</category>
    </item>
  </channel>
</rss>
