The first thing most Discord bot tutorials do is add a framework. A "bot framework" with a plugin system, a command registry, an event bus, and a configuration layer. For a bot that says "ping" when you say "pong," that's like buying a crane to hang one picture.
The Discord Bot template in scaffoldx-cli takes the opposite position: discord.js, slash commands, and an event handler — and nothing else. No framework, no plugin system, no abstractions you haven't asked for.
This post is the case for that position, and the honest accounting of when you should reach for the framework anyway.
What the template ships
The generated bot is three things:
-
A client that connects with your token (read from the environment, never committed — the template's
.gitignoreexcludes.envand ships.env.examplewithDISCORD_TOKEN=your-token-here). -
A slash-command registration step that registers a starter
/pingcommand with the API, so the first run has a working command to test against. -
An event handler skeleton —
messageCreateand the command interaction handler — with the routing logic explicit and short enough to read in one sitting.
The whole generated index.js is under 100 lines. You can read the entire bot, including the parts you didn't write, in five minutes.
Why "no framework" is a feature, not a limitation
1. The abstraction tax is real, and it's paid in debugging. A bot framework's command registry is convenient until the command doesn't fire, and you spend an hour discovering that the registry's matching logic normalizes command names in a way your input didn't. With discord.js's native interaction handler, the routing is two lines of code you can trace in your head. The framework's abstraction is a wall between you and the actual event, and for a small bot, that wall is pure cost.
2. discord.js is already the framework. This is the key point people miss: discord.js v14 is a complete, well-maintained library. It has the client, the event system, the interaction router, and the REST API. The "bot framework" layer on top is solving problems that discord.js already solved, for the convenience of a structure that only pays off at a certain scale. Below that scale, it's a middleman.
3. The template scales by adding, not by migrating. When the bot outgrows 100 lines, you don't migrate to a framework — you add files. A commands/ directory, a small router, a config module. Each addition is a normal Node.js refactor, visible in the diff, with no framework migration in the middle. The "no framework" start doesn't trap you; it just delays the abstraction until you actually need it.
When you should use the framework anyway
Honest counterargument, because "no framework" is not universally right:
- Large teams, many contributors. A framework's command registry and plugin conventions are a coordination tool — they make 10 people add commands without colliding. If your bot is a team product with 5+ contributors, the framework's structure is worth its tax.
- Plugin architecture as a product. If the bot's feature is that users can install plugins, you need the plugin system. That's a product requirement, not a convenience.
- You've already chosen an ecosystem. If your team standardizes on a framework for consistency across projects, consistency has its own value.
For the common case — a small bot, one or two developers, a feature list you can hold in your head — the no-framework start is the faster path to a working bot, and the path that keeps the code readable as it grows.
The practical start
npx scaffoldx-cli
# choose: Discord Bot
# name it, npm install, put your token in .env
node index.js
First run registers /ping, and the bot answers in the channel where you invoke it. That's the whole demo loop — no framework setup, no plugin config, no reading a framework's documentation before you've written a single line of your own logic.
The template's job is to get you from "I want to build a Discord bot" to "my bot is responding to a slash command" in the minimum number of steps that don't involve reading a framework's architecture doc. Everything you add after that is your design, on a base you fully understand.
npx scaffoldx-cli
More Tools
| Tool | What it does | Command |
|---|---|---|
| scaffoldx-cli | Production-ready project templates in seconds | npx scaffoldx-cli |
| dotguard | Scan .env files for exposed secrets | npx @wuchunjie/dotguard |
| gitpulse | Git repo analytics in your terminal | npx @wuchunjie/gitpulse |
| snippetx | Terminal code snippet manager | npx @wuchunjie/snippetx |
If these save you time, consider buying me a coffee. All tools are MIT-licensed, zero-dependency, and run fully offline.
Top comments (0)