Discord bot guides: build it and keep it online
You can build a Discord bot in an afternoon; the hard part is keeping it online after you switch your computer off. Here are our guides, from the first line of code to hosting.
Start here
How to Make a Discord Bot in Python (discord.py), Step by Step
Your first bot in Python with discord.py, step by step.
How to Make a Discord Bot in JavaScript (discord.js), Step by Step
Or in JavaScript with discord.js, if you prefer Node.js.
Discord Bot in TypeScript (discord.js): From Zero to Always Online
The same bot in TypeScript, with types, and how to compile it for hosting.
Discord Bot Hosting: Keep Your Bot Online, Free or Paid
Where to host it so it stays online even when your PC is off.
Complete bots to copy
Discord Moderation Bot in Python: Warn, Mute, Kick, Ban and Purge Messages
Build your own Discord moderation bot in Python: /warn with history, /mute, /kick, /ban, /purge messages and a log channel. Full code.
Discord Giveaway Bot in Python: Enter Button, Random Winners and Rerolls
Build your own Discord giveaway bot in Python: /giveaway with an enter button, countdown, random winners and /reroll. Full code, no ads.
Discord Role Bot: Buttons So Everyone Picks Their Own Roles (Python and JavaScript)
Make your own Discord self-role bot in Python or JavaScript: a message with buttons to add and remove roles, no database and no reaction roles needed.
Discord Bot That Announces Your Twitch Streams and YouTube Videos
Make a Discord bot that posts in a channel when you go live on Twitch or upload a YouTube video: Python code, the keys you need and where to keep it online.
Discord Leveling Bot: XP for Messages, Leaderboard and Roles (Python and JavaScript)
Make your own Discord leveling bot in Python or JavaScript: spam-proof XP for messages, /level, /leaderboard and roles on level-up, stored in SQLite.
How to Make an AI Discord Bot (ChatGPT, Gemini…) in Python
Make a Discord bot that answers with AI: an /ask command in Python that uses ChatGPT, Gemini or another AI, with its key kept safe and your credit protected.
Discord Music Bot: Make Your Own in Python or JavaScript
Why the big Discord music bots shut down and how to build your own with a queue and /play (discord.py or discord.js), with what voice requires since 2026.
Discord Welcome Bot: Join Message and Auto Role (Python and JavaScript)
Build a Discord bot that greets new members and gives them a role automatically, in Python or JavaScript: the missing intent, role order and rules screening.
How to Make a Discord Ticket Bot in Python (discord.py)
Build your own Discord ticket bot with discord.py: a button that opens a private channel with your team, one per person, that keeps working after restarts.
Discord Verification Bot in Python: a Button and a Question Before Joining
Build your own Discord verification bot with discord.py: a “Verify me” button, an anti-bot question and a role that unlocks the server. Full code, free.
Discord Bot Showing Your Minecraft Server Status (Players Online)
Build a Discord bot in Python that shows whether your Minecraft server is online, how many are playing and who, with /status. Full code, free.
When something goes wrong
Discord Bot Not Responding (or Showing Offline): Causes and Fixes
Your Discord bot doesn't reply or shows as offline: token, Message Content Intent, permissions, error 429… Each error and its fix in discord.py and discord.js.
My Bot's Slash Commands Aren't Showing: Syncing in discord.py and discord.js
Why your Discord bot's slash (/) commands don't appear and how to publish them: tree.sync() in discord.py, REST.put in discord.js, global or per server.
Frequently asked questions
Can I keep a Discord bot online all the time for free?
Yes, with limits. NapNodes has a free 256 MB bot that isn't stopped for being idle; you renew it with one click every 7 days (the free options, with their downsides).
Which language is best for a Discord bot?
Python (discord.py) and JavaScript (discord.js) are the most used and have the most help online. Pick the one you already know.
Why is my bot online but not replying?
It's almost always missing the Message Content Intent (to read messages) or permissions in that channel; if it's slash commands that don't show up, they haven't been published. Each case, in my Discord bot isn't responding.
Create your free botNo card needed. Or see the Discord bots plans.