GuidesEspañolContact

How to make a Discord bot

To make a Discord bot you create an application in the Discord developer portal, invite its bot to your server, code what it does with a library like discord.js (JavaScript) or discord.py (Python) and host it on a server that keeps it online all day. These are the steps and what is worth knowing before you start.

  • ⏱ 2 min read
  • 5 sections
  • 2 diagrams

Updated:

Step 1: create the application

Go to the Discord developer portal (discord.com/developers/applications), create a new application and give it a name and image. In the Bot section you get the token, which works as the bot’s password: whoever has it can control the bot, so never publish it or push it to a repository. In the same section you turn on the intents you need, for example message content if the bot has to read messages.

Four steps to make a Discord bot: create the application in the developer portal, invite it, code it with discord.js or discord.py and host it on a server.
From the Discord portal to a bot that is online all day.

Step 2: invite the bot to your server

In the OAuth2 section you generate an invite link with the bot and applications.commands scopes, and tick only the permissions the bot needs. Opening the link lets you pick the server, and the bot shows up in the member list, offline until its code starts running.

Step 3: code it

The most used libraries are discord.js, in JavaScript with Node.js, and discord.py, in Python. With them the bot connects, registers its slash (/) commands and reacts to events: someone joins, writes, reacts or presses a button. If the bot stores data, like levels or coins, you will also need a database.

Minimal discord.js bot code that answers the hello command, and the result on Discord.
A minimal discord.js bot. The /hello command is registered separately.

Step 4: keep it online

The bot only works while its code is running. On your computer it stops when you switch it off, which is why bots a community really relies on are hosted on a virtual server (VPS) with a process manager that restarts them if they crash. Free options usually have limits or put the bot to sleep when nobody uses it.

When to hire it out instead

Making a simple bot is a good project to learn. Hiring it out makes sense when you need it soon, when it handles your community’s data or when it has to grow with an economy, web panels or integrations without breaking.

Your checklist

0/4

Tick what you already have. It stays saved in this browser.

Was this guide useful?

Frequently asked questions

Do I need to know how to code to make a Discord bot?

For your own, yes: the basics of JavaScript or Python. Without coding you can use configurable public bots or hire a custom one.

Is making a Discord bot free?

Creating the application and the bot on Discord is free. What costs is the time to code it and the server that hosts it so it is always online.

discord.js or discord.py?

Both work for almost everything. Pick the language you know best: discord.js if you come from JavaScript, discord.py if you come from Python.

How much does it cost to hire a Discord bot?

A simple bot starts at $150 and a custom one at $500. Large projects are quoted separately, with the price agreed before work starts.

Need a hand with this?

Message me on Discord or WhatsApp. I reply in under 24 hours.

Link copied