/ build-guides / How to Build a Discord Bot as a Solo Developer
build-guides 10 min read

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.

Hero image for How to Build a Discord Bot as a Solo Developer

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

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

Built by Kevin

Like this? You'll like what I'm building too.

Two ways to support and get more of this work.

Desktop App

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 more
Digital Products

MY 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 Whop

Need This Built?

Kevin builds products solo, from first version to live. If you want something like this made, work with him.