Guides

Guides

Making a Discord bot in Python or JavaScript, keeping it online, and fixing it when it breaks. Useful whether or not you host with us.

Your first bot

Make a Discord bot in Python

Build your first Discord bot in Python with discord.py: slash commands, replies to messages, embeds, buttons, and fixes for the usual errors.

15 minBeginnerPython

Make a Discord bot in JavaScript

Build your first Discord bot in JavaScript with discord.js 14: slash commands, replies to messages, embeds, buttons, and keeping it running.

14 minBeginnerJavaScript

Make a Discord bot in Java with JDA

Build your first Discord bot in Java with JDA 6: slash commands, an embed, a button, replies to messages, a runnable jar, and fixes for the usual errors.

15 minBeginnerJavaScriptJava

Keeping it online

How to keep a Discord bot online 24/7

Your bot goes offline when your PC sleeps. Here is every realistic way to keep it running around the clock, what each costs, and the catches.

7 minBeginner

How to choose Discord bot hosting

What matters when picking a Discord bot host: sleeping, reserved memory, current Python and Node, Git deploys, crash restarts, backups and renewals.

9 minBeginner

Moving a Discord bot off Replit or Heroku

Move a Discord bot off Replit or Heroku to a host where it stays online: export the code, replace Replit DB and Secrets, drop keep-alive pings.

8 minBeginnerPython

Discord bot sharding: when you need it and how

When a Discord bot has to shard (2,500 servers), what a shard is, and how to do it in discord.py and discord.js: one process or several, memory and limits.

7 minBeginnerPythonJavaScript

Deploying your bot

How to host a discord.py bot

Prepare a discord.py bot for hosting: read the token from the environment, pin dependencies, and deploy it so it stays online. Step by step.

6 minBeginnerPython

How to host a discord.js bot

Get a discord.js bot ready for hosting: token in the environment, a clean package.json, intents, slash commands, then keep it online 24/7.

7 minBeginnerJavaScript

How to host a JDA (Java) Discord bot

Get a JDA Discord bot ready for hosting: a fat jar with Gradle or Maven, the token from the environment, intents, heap size and shutdown.

7 minBeginnerJava

Deploy a Discord bot from GitHub

Run your Discord bot straight from a GitHub repository: keep the token out of it, use private repos safely, and redeploy on every push.

6 minBeginner

Building features

Slash commands in discord.py

Slash commands in discord.py 2: sync them properly, options, choices, autocomplete, permissions, cooldowns, groups, and fixing ones that don't show.

11 minIntermediatePython

Slash commands in discord.js

Slash commands in discord.js 14: register them, options, autocomplete, permissions, cooldowns, subcommands, right-click commands, and fixes.

13 minIntermediateJavaScript

Buttons, select menus and modals in discord.js

Buttons, select menus and pop-up forms in discord.js 14: builders, handling the interaction, collectors with time limits, modals with labels, and errors.

10 minIntermediateJavaScript

Embeds in discord.py

Send embeds with discord.py 2: fields, colours, images from your own files, timestamps, editing, the size limits, and why an embed does not show.

8 minIntermediatePython

Embeds in discord.js

Send embeds with discord.js 14's EmbedBuilder: fields, colours, images from your own files, timestamps, editing, the limits, and the errors people hit.

8 minIntermediateJavaScript

How to send Discord webhook messages from code

Post to a Discord channel without a bot: create a webhook, send text and embeds from Python, JavaScript or curl, attach files, edit messages, rate limits.

7 minIntermediatePythonJavaScript

Add a database to a Discord bot

Give a discord.py or discord.js bot a real database: SQLite first, with a working warnings system, then MySQL when you outgrow it, and the usual errors.

12 minIntermediatePythonJavaScript

Organising a discord.py bot with cogs

Split a discord.py 2 bot into cogs: file layout, loading in setup_hook, slash and prefix commands, listeners, reloading and common errors.

8 minIntermediatePython

Scheduled tasks in a Discord bot

Run code on a schedule in a Discord bot: discord.py tasks.loop, setInterval and node-cron in discord.js, time zones, restarts and rate limits.

7 minIntermediatePythonJavaScript

Running a community

Fixing problems

Discord bot is online but not responding

Your bot shows as online but ignores commands. The eight usual causes, from the Message Content intent to on_message, and how to check each.

7 minIntermediatePython

Discord API rate limits, explained

What Discord's rate limits are, what a 429 means, the global and invalid-request limits that get bots temporarily banned, and how to stop hitting them.

7 minIntermediate

How much RAM does a Discord bot need?

Realistic memory use for Python Discord bots, what makes it grow (member cache, message cache, music, images), how to measure yours and how to cut it.

6 minIntermediatePython

Security

Keeping your Discord bot token safe

A leaked bot token gives someone full control of your bot. How tokens leak, how to store one safely, and exactly what to do if yours gets out.

5 minIntermediatePython

Websites and dashboards

How to host a Django app on your own domain

Run Django in production: gunicorn, DEBUG off, ALLOWED_HOSTS and CSRF behind a proxy, static files with WhiteNoise, migrations, and HTTPS on your domain.

8 minIntermediatePython

How to host a Next.js app on your own domain

Run Next.js on your own server: next start or standalone output, the port and hostname, why the build needs far more memory than the app, and HTTPS.

8 minIntermediateJavaScript

Press / or Ctrl K on any page to search.