Blog

How to Make a Discord Bot: Step by Step (With and Without Code)

A Discord bot is an account that works for you on your server: it answers commands, hands out roles and posts notifications. Below we go through creating a bot from scratch, adding it to your server and keeping it running.

Published:

1. Create the application

At discord.com/developers/applications, create an application with 'New Application' and give your bot a name. In the Bot tab you can set the bot's username and picture.

2. Get the token and keep it safe

In the Bot tab, 'Reset Token' gives you the token, which works like the bot's password. Never share it and never write it into code you push to GitHub; if it leaks, someone else controls your bot. If you think it has leaked, reset it right away.

3. Turn on the intents

If the bot will read message content, turn on the Message Content Intent in the same tab; if it will track members, turn on the Server Members Intent. Do not switch on what you do not need; the fewer permissions a bot runs with, the safer it is.

4. Add the bot to your server

In the URL Generator under OAuth2, select the bot and applications.commands scopes, then the permissions the bot needs. Open the generated link and add the bot to a server you manage.

5. Write the code: discord.js or discord.py

The two most common libraries are discord.js for Node.js and discord.py for Python. Commands today are mostly written as slash commands; Discord lists them for users and autocompletes them. The usual first step is a bot that answers a /ping command.

6. Keep the bot running 24/7

The bot is online only while the computer running its code is on. You can test on your own computer; to keep it online it is installed on a small virtual server (VDS) and set to restart by itself if it stops.

No-code bot makers

With no-code tools such as BotGhost, simple bots can be set up in minutes. If you need a system made for your server, a database, payments or a link to another site, a bot written in code is more flexible.

Shall we write the bot?

We write Discord, Telegram and WhatsApp bots and hand them over running; a custom bot starts from $30 and is usually delivered in 2-5 days.

Related service

Bot Development

Tell us the idea and we will shape the scope and budget together. On weekdays we usually reply within one business day.

  • Free quote
  • Usually a reply within one business day
  • Scope and price agreed before we start

or write to us directly: contact@torpilstudio.com

WhatsApp: +90 546 401 33 90Book a free 15-minute call →

Tell us about your project

Your projectStep 1 of 2

What do you need?
Your budget (optional)