Making a Discord bot in 2026 comes down to four steps: register an application in the Discord developer portal, create a bot and copy its token, install a bot library, and write a few lines of code that respond to commands. A working bot that replies to a message is genuinely achievable in an afternoon, even for a near-beginner. The harder parts come later with hosting and advanced features. This guide walks through the full beginner path and the mistakes that trip people up.
What you need first
Before any code, set up the bot on Discord side. This trips up beginners who jump straight to coding.
| Step |
Where |
Result |
| Create an application |
Discord developer portal |
A container for your bot |
| Add a bot to it |
Same portal, Bot tab |
A bot user and a secret token |
| Set intents |
Bot settings |
Permission to see messages and members |
| Invite the bot |
OAuth2 URL generator |
The bot joins your test server |
Keep the token secret. It is effectively your bot password, and leaking it lets anyone hijack the bot.
Choose a language and library
You write the bot in a language you already know, using a library that handles the connection. The two most popular choices in 2026 are a Python library and a JavaScript library, both mature and well documented. Pick the language you are more comfortable with; the concepts are identical. If you are still learning the basics, see how to learn Python fast first.
// a minimal bot that replies to a command
@bot.command()
async def hello(ctx):
await ctx.send("Hello from my bot")
Run the script with your token loaded from an environment variable, type the command in your server, and the bot replies. That single round trip is the whole foundation; everything else is more commands and more logic.
Build up features step by step
- Respond to a command. Start with the simplest possible reply, as above.
- React to events. Greet new members or respond when a keyword appears.
- Add useful commands. A dice roller, a reminder, a lookup against a public API.
- Handle errors gracefully. Catch bad input so one mistake does not crash the bot.
- Move secrets to environment variables. Never hardcode the token in your file.
Add one feature at a time and test it before moving on. A bot grows naturally from a single working command.
Hosting and going live
While developing, the bot runs on your own machine and stops when you close it. To keep it online you need a host that runs the script continuously, such as a small cloud server or a free tier hosting service. Start free and simple; you do not need paid infrastructure to run a hobby bot. If you want a fully separate first app, compare it to building your first app.
What to skip
- Skip complex hosting early. Run it locally until the logic works, then move to a simple host.
- Skip paid bot frameworks. The free standard libraries do everything a beginner needs.
- Skip AI and voice features at first. Get a reliable text command bot working before adding anything fancy.
- Skip committing your token. Never push the token to a public repository; rotate it immediately if you do.
FAQ
Do I need to know how to code to make a Discord bot?
You need basic programming skills in Python or JavaScript. The libraries handle the hard networking, so a confident beginner can build a simple command bot, but you do need to write some code.
Is it free to make a Discord bot?
Yes. Registering the bot and the standard libraries are free, and you can develop on your own computer at no cost. Paid hosting is optional and only needed to keep the bot online constantly.
Why is my Discord bot not responding to messages?
Most often the message content intent is not enabled in the developer portal, so the bot cannot read messages. Check that the required intents are turned on and that the bot has permission in the channel.
Can a Discord bot use AI in 2026?
Yes. You can connect a bot to an AI model through an API so it answers questions or generates text. Build a reliable basic bot first, then add AI as a later feature once the core works.
Where to go next
Learn Python fast for your bot, build your first app from scratch, and learn coding as a beginner.