How to Build a Discord Bot as a Solo Developer
Step-by-step guide to building a Discord bot by yourself. Tech stack, timeline, costs, and practical advice.
What You're Building
A Discord bot that lives in servers and does useful things automatically. Moderation, music, games, utility commands, AI chat, notifications, or whatever niche you can think of. Discord bots are one of the best beginner-to-intermediate projects because the feedback loop is instant (run a command, see the result), and the Discord API is well-documented.
I built my first Discord bot because I was tired of manually assigning roles in a server I moderated. That bot took about four hours to build. Three years later, it's still running and handles thousands of role assignments a month. Bots are one of those projects where a simple idea can genuinely save people time.
Difficulty & Timeline
| Aspect | Detail |
|---|---|
| Difficulty | Easy to Medium |
| Time to MVP | 1-2 weeks |
| Ongoing Maintenance | Low to Medium |
| Monetization | Premium commands, server subscriptions, freemium tiers |
Recommended Tech Stack
Discord.js with Node.js is the most popular choice and has the biggest ecosystem. The current release is discord.js v14.26.4, it requires Node.js 18 or newer, and it pulls about 683,000 npm downloads a week with around 26,700 GitHub stars, so you are never short on examples or answers. If you prefer Python, discord.py is equally solid. The current release is v2.7.1, it requires Python 3.8 or newer, and it sits at roughly 16,100 GitHub stars. Both have excellent communities and plenty of tutorials. For Node, install the current LTS, which is v24 (Krypton) as of this writing.
For hosting, the cheap-and-reliable starting points have shifted. Fly.io removed its always-on free allowance for new signups in 2024, so new accounts now get a short trial rather than a permanent free tier. A minimal always-on shared-CPU machine on Fly.io runs around $1.94 per month, which is still close to free for a small bot. Railway no longer has a true free plan either. New accounts get a one-time $5 trial credit with no card required, and the Hobby plan is $5 per month with that usage bundled in. Once your bot grows, move to a small VPS. Hetzner's CX22 is around $4.35 to $4.59 per month for 2 vCPU, 4GB RAM, and 40GB SSD after the April 2026 price adjustment, and DigitalOcean's cheapest basic Droplet starts at $4 per month for 1 vCPU and 512MB RAM. Check current pricing before you commit, since these tiers move. Don't use serverless for Discord bots. They need a persistent WebSocket connection, which doesn't work with Lambda-style functions.
If your bot needs a database (storing user preferences, server configs, points systems), use SQLite for small bots or PostgreSQL for larger ones. SQLite runs in-process, requires zero setup, and handles surprising amounts of data before you need to upgrade.
Step-by-Step Plan
Phase 1: Foundation (Day 1-3)
Create a Discord application in the Developer Portal, add a bot user, and invite it to your test server. Set up your Node.js project with Discord.js and get the bot online. With Node 18 or newer installed, the install is a single command: npm install discord.js (which currently resolves to v14.26.4). You should see the bot appear in your server's member list within the first hour.
Implement slash commands. Discord deprecated traditional prefix commands in favor of slash commands, and if you want your bot verified for more than 100 servers, slash commands are required. Register a few basic commands: /ping, /help, and one command that does something useful related to your bot's purpose.
I'd also set up a proper command handler from the start. Put each command in its own file, load them dynamically, and use a structure that makes adding new commands trivial. This takes an extra hour upfront but saves you from refactoring later.
Phase 2: Core Features (Week 1-2)
Build the commands and systems that make your bot unique. If it's a moderation bot, build the warn/mute/ban system with logging. If it's a utility bot, build the features people actually need. If it's a game bot, build the core game loop.
Handle errors gracefully. Discord bots crash. APIs fail. Rate limits happen. Wrap your command handlers in try-catch blocks, log errors properly, and make sure the bot reconnects automatically. I once deployed a bot that crashed on an unhandled promise rejection and stayed offline for three days before I noticed. Don't be me.
Add per-server configuration if your bot will be in multiple servers. Every server wants to customize which channels the bot posts in, what prefix to use, or which features are enabled. Store this in your database and load it on every command execution.
Phase 3: Polish & Launch (Week 2-3)
Create a support server for your bot. This is where users report bugs, request features, and help each other. It also doubles as social proof when someone is deciding whether to add your bot.
Build a simple landing page with your bot's features, an "Add to Server" button, and basic documentation. Use top.gg to list your bot. It's the biggest Discord bot directory and brings in organic traffic.
Submit for Discord verification as you approach the limit. Per Discord's developer docs, verification is required for an app to scale past 100 servers, and if your bot uses privileged intents you apply for those once you are in 75 servers or more. The process involves describing your bot's functionality and data handling, and it usually takes a few weeks. Have a published privacy policy URL ready, since it is one of the core verification requirements.
Monetization Strategy
Discord bots have a few proven monetization models. The most common is premium commands or features. Free users get basic functionality, paid users unlock advanced features. Use Stripe for payments and store premium status per server or per user in your database.
Server subscriptions work well for bots that provide significant value. Charge $3-10/month per server and give server admins a dashboard to manage their subscription. Patreon integration is another popular approach, where supporters get premium features across all their servers.
Here's what I've seen work best: make the free tier genuinely useful, then add premium features that power users and large servers want. Things like advanced logging, custom branding, API access, or higher rate limits. A bot with 500 free servers and 50 paying $5/month is $250/month in recurring revenue. Not life-changing, but not bad for a side project.
One underrated monetization approach is offering custom bot development as a service. Once you've built one bot, you have the skills. Plenty of communities and businesses want custom Discord bots and are willing to pay $500-2000 for one.
Common Mistakes to Avoid
Not handling rate limits. Discord will rate-limit your bot if it sends too many API requests. Use the built-in rate limit handling in Discord.js, and don't try to send messages in a tight loop. I learned this the hard way when my bot got temporarily banned from the API during a server raid.
Storing tokens in code. Use environment variables. I've seen bot tokens committed to public GitHub repos. Within minutes, someone will find it and use your bot to spam servers. It happens faster than you'd expect.
Building too many commands before testing. Ship 3-5 commands, get people using them, and then build more based on feedback. My most popular bot command was one I almost didn't build because I thought nobody would use it.
Ignoring slash command autocompletion. Slash commands support autocomplete, which makes the user experience way better. If your command takes a channel name as input, autocomplete it. If it takes a user, autocomplete it. These small UX touches are what separate good bots from great ones.
Is This Worth Building?
Definitely, especially as a learning project or a side income generator. Discord has hundreds of millions of users, and bot development has a lower barrier to entry than almost any other type of software.
The reality check is this: the bot market is competitive for general-purpose bots (moderation, music, economy). If you're building yet another moderation bot, it'll be hard to stand out. But niche bots can do incredibly well. Bots for specific games, specific workflows, or specific communities have less competition and higher loyalty from users.
The skills transfer well too. Building a Discord bot teaches you real-time systems, API integration, database management, and deployment. Those skills apply directly to building any other kind of software. And unlike a portfolio project that nobody uses, a Discord bot gets real users with real feedback almost immediately. There's something addictive about watching your bot's server count climb.
Common Errors and Fixes
These are the failures you will almost certainly hit early. Each one maps to a specific cause grounded in the official docs.
"Used disallowed intents" on startup. Your bot crashes the moment it logs in because you requested a privileged intent (Message Content, Server Members, or Presence) without enabling it. Discord gates these behind a toggle in the Developer Portal under your application's Bot settings, and unverified apps must flip the switch there before the gateway will let the connection through. Enable only the intents you actually use, then restart.
Slash commands don't show up. Globally registered commands can take up to an hour to propagate across Discord, while guild-scoped commands register almost instantly. During development, register commands to a single test guild so you see them immediately, then switch to global registration for production. If a command still does not appear, confirm your bot was invited with the applications.commands OAuth2 scope, not just bot, otherwise Discord silently refuses to register commands for that install.
Node version too old. discord.js v14 requires Node.js 18 or newer. On an older runtime you will see syntax or module-resolution errors that look unrelated to Discord. Check with node -v and install the current LTS (v24, Krypton) if you are behind.
Getting rate limited (HTTP 429). Discord returns a 429 with a retry_after value when you send requests too fast. discord.js queues and retries within the global rate limit automatically, so the fix is almost always your own code sending in a tight loop. Batch edits, avoid editing a message on every event, and respect the retry_after window rather than hammering the endpoint.
Bot stops at 100 servers. This is not a bug. An app cannot join its 100th-plus server until it is verified, per Discord's developer docs. Plan verification before you reach the cap so growth does not stall.
Sources
- discord.js current version (v14.26.4), Node engine requirement, and weekly download count: registry.npmjs.org/discord.js and api.npmjs.org last-week downloads (checked-on 2026-05-30)
- discord.js GitHub stars (26,717): api.github.com/repos/discordjs/discord.js (checked-on 2026-05-30)
- discord.py current version (v2.7.1) and Python requirement: pypi.org/pypi/discord.py/json (checked-on 2026-05-30)
- discord.py GitHub stars (16,072): api.github.com/repos/Rapptz/discord.py (checked-on 2026-05-30)
- Node.js current LTS (v24, Krypton): nodejs.org/dist/index.json (checked-on 2026-05-30)
- Railway pricing (one-time $5 trial credit, Hobby $5/month with included usage): railway.com/pricing (checked-on 2026-05-30)
- Fly.io pricing (pay-as-you-go, minimal shared-CPU machine around $1.94/month, free allowance removed for new signups): fly.io/pricing (checked-on 2026-05-30)
- Hetzner CX22 pricing (around $4.35 to $4.59/month after the April 2026 adjustment): hetzner.com/cloud/cost-optimized (checked-on 2026-05-30)
- DigitalOcean Droplet pricing (basic Droplet from $4/month): digitalocean.com/pricing/droplets (checked-on 2026-05-30)
- Discord bot verification and privileged intents thresholds (verification required past 100 servers, intent applications open at 75 servers): support-dev.discord.com How Do I Get My App Verified and support-dev.discord.com How do I get Privileged Intents (checked-on 2026-05-30)
Like this? You'll like what I'm building too.
Two ways to support and get more of this work.
HEARTH
A privacy-first Life OS for your desktop. Journal, tasks, and notes that stay on your machine. Coming soon, direct download from this site.
Read moreMY TOOLKITS
Receipts-first toolkits for shipping after hours, building Claude agents, publishing on Amazon, and more. The exact methods I used, not theory.
Browse on WhopRelated Articles
Treating Video As Code With Remotion And fal
How I turned a script into a finished video with code instead of a timeline app, and why determinism is the real win for a solo dev.
Build Versus Buy For A Custom AI Feature
How to decide between an off-the-shelf AI tool and a custom AI feature, weighing control, cost, differentiation, and data with a clear framework.
Can One Developer Build Your Whole MVP
An honest look at whether a single full-stack developer can ship your whole MVP, when it works beautifully, and when you should bring in more people.