help

Set up your bot.

Got your zip? These steps take about 30 minutes the first time. No coding needed. Search for a word, or use the list to jump to a step.

Setup steps

Never share your bot token.

The token is your bot’s password. Anyone who has it can control your bot, and your server with it. Don’t post it in chat, send it in a message, put it in a screenshot or upload it anywhere. If it ever leaks, reset it right away (Step 4 shows how).

I’m on

0Before you start

Your bot is a small program written in Python (it uses the discord.py library). It runs on your computer or on a small server, and talks to Discord over the internet. You don’t need to know how to code. You just follow these steps once.

You will need

  • The zip file we delivered with your order.
  • A Discord account and a server you own (or one where you can manage roles and channels).
  • A computer: Windows, Mac or Linux, with internet.
  • About 30 minutes the first time.

Every bot we build comes with its own README.md inside the zip. If something in that file is different from this page, follow the README. It was written for your exact bot.

The order of the steps: make the bot in Discord (Steps 2–6), get your computer ready (Steps 7–10), build and start (Steps 11–12), then keep it online (Step 13).

1What’s in your zip

Unzip it and have a look. The exact files depend on your package, but a bot we build looks like this:

README.mdYour bot’s own guide. Read it too.
bot.pyThe file that starts your bot.
requirements.txtThe list of add-ons the bot needs. pip reads it.
.env.exampleA blank settings file. You copy it to .env and fill it in.
setup_server.pyIf your package builds your server: creates your roles, channels and messages. You run it once.
content/If included: the texts for your welcome, rules and so on, as simple .md files you can edit.
start-bot.bat start-bot.commandIf included: double-click to start the bot (Windows / Mac). It also restarts the bot if it stops.
other .py filesThe bot’s features, one file each (tickets, levels, moderation…). You don’t need to open them.

Some files appear after you run the bot: .env (you make it), state.json (remembers the IDs of what setup built), a data/ folder (saved levels, giveaways and so on) and a backups/ folder. Keep them next to the bot.

2Make the bot in the Discord Developer Portal
  1. Go to discord.com/developers/applications and log in with your Discord account.
  2. Click New Application, type a name (this becomes your bot’s name) and click Create.
  3. Optional: on General Information you can add a profile picture.
  4. Click Bot in the menu on the left. You’ll use this page in the next two steps.
3Turn on the two intents

“Intents” are permissions Discord makes you switch on before a bot can see certain things. The bots we build ask for two of them, and they will not start if you skip this.

  1. Still on the Bot page, scroll down to Privileged Gateway Intents.
  2. Switch ON: Server Members Intent (so the bot can see people joining and leaving) and Message Content Intent (so it can read messages for things like the chat filter, levels and suggestions).
  3. Leave Presence Intent off.
  4. Click Save Changes.

If your README asks for something different, follow your README.

4Copy your bot token
  1. On the Bot page click Reset Token and confirm.
  2. Click Copy. Discord only shows the token once, so paste it somewhere private right away (you’ll put it in a file in Step 9).

Keep it secret. Never paste the token into Discord, a screenshot, a video, GitHub or a message to anybody. If you think it leaked, come back here, click Reset Token again, and put the new token in your .env file. The old one stops working at once.

5Invite the bot to your server
  1. In the Developer Portal click OAuth2 in the left menu and copy the Client ID (a long number).
  2. Paste it into this link in place of YOUR_CLIENT_ID, then open the link in your browser:
    https://discord.com/oauth2/authorize?client_id=YOUR_CLIENT_ID&permissions=2253277550996502&scope=bot+applications.commands
  3. Choose your server and click Authorize. You may need to prove you’re human.

What that link asks for

  • scope=bot adds the bot as a member of your server.
  • applications.commands lets the slash commands (the ones that start with /) show up.
  • permissions=2253277550996502 gives the bot only the permissions it needs, like manage roles, manage channels, moderate members, pin messages and thread controls. It does not include Administrator.

You can also build a link yourself: OAuth2 → URL Generator, tick bot and applications.commands, then pick the same permissions. You do not need to tick Administrator.

6Turn on Developer Mode and copy your IDs

Every server, channel and role in Discord has a secret ID number. Your bot needs to know yours.

  1. In Discord open User Settings (the gear next to your name) → Advanced and switch on Developer Mode.
  2. Server ID: right-click your server icon and choose Copy Server ID. This is your GUILD_ID. Paste it somewhere for Step 9. (“Guild” is just Discord’s old word for server.)
  3. Role ID: open Server Settings → Roles, right-click a role and choose Copy Role ID. You only need this if your .env has a line asking for a role, such as AUTO_ROLE_ID.
  4. Channel ID: right-click a channel and choose Copy Channel ID, if your .env asks for one.
  5. Private staff server: if your package has one, make a new empty server, invite the bot to it with the same link, and copy that server’s ID the same way (usually STAFF_GUILD_ID).
7Install Python 3.10 or newer

Windows

Download Python from python.org/downloads. In the installer, tick “Add python.exe to PATH” before you click Install. This is the step people forget.

To check it worked, press the Windows key, type cmd, press Enter, and run:

python --version

If Windows says Python isn’t found, try py --version. If that works, use py wherever this guide says python.

Mac

Download Python from python.org/downloads and open the installer, or run brew install python if you use Homebrew. Then open the Terminal app and run:

python3 --version

Linux

Most Linux systems already have Python 3. On Ubuntu or Debian, make sure the tools we need are there:

sudo apt update
sudo apt install -y python3 python3-venv python3-pip
python3 --version

It should print a number like Python 3.12.4. Anything 3.10 or higher is fine.

8Unzip the bot and open a terminal in its folder

Unzip your bot to a folder you’ll keep, for example Documents/MyBot. Don’t run it from inside the zip. A terminal is the text window where you type commands. Open one inside the bot’s folder:

Windows

Open the folder in File Explorer, click the address bar at the top, type cmd and press Enter. A black window opens in that folder.

Mac

Open Terminal, type cd and a space, drag the bot’s folder into the window, and press Enter.

Linux

Open a terminal and go to the folder, for example:

cd ~/Documents/MyBot

Not sure you’re in the right place? List the files. You should see bot.py:

dir
ls
9Fill in your settings (the .env file)

The .env file holds your bot’s secrets and settings. You make it by copying .env.example.

Windows

copy .env.example .env

Mac / Linux

cp .env.example .env

Files that start with a dot can be hidden. Windows: in File Explorer choose View → Show → Hidden items. Mac: in Finder press Cmd + Shift + .. Linux: press Ctrl + H in your file manager.

Open .env in Notepad, TextEdit or any text editor and fill in at least:

DISCORD_TOKEN=paste-your-token-here
GUILD_ID=paste-your-server-id-here
  • DISCORD_TOKEN is the token from Step 4.
  • GUILD_ID is your server ID from Step 6.
  • No quotes and no spaces around the values. Lines that start with # are just notes.
  • Other lines (a role ID for new members, a staff server ID, your timezone, names) are optional. The notes in the file explain each one. Leave a line empty to skip it.
  • The file must be named exactly .env, not .env.txt. Save, close, done.

This file now contains your token. Don’t send it to anyone, and don’t upload it to GitHub or any public place.

If you want new members to get a role automatically

If your .env has AUTO_ROLE_ID, paste the role’s ID (from Step 6) after it. The bot’s own role must sit above that role: open Server Settings → Roles and drag the bot’s role higher than the one you want it to give out. Discord never lets a bot hand out a role that is above its own.

10Install the add-ons

In the terminal you opened in Step 8, run these lines one at a time. The first makes a private box (a “virtual environment”) for the bot’s add-ons, the second turns it on, and pip install downloads everything in requirements.txt.

Windows

python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt

Mac / Linux

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

You’ll see a lot of text scroll by. That’s normal. When your cursor comes back, it’s done. After activate you’ll see (.venv) at the start of the line.

Closed the terminal later? Open a new one in the folder and run the activate line again before running the bot. If your zip has a start-bot file, it does all of this for you.

11Build your server (if your bot has setup_server.py)

Standard and Premium bots can build your roles, channels and welcome and rules messages for you. If your zip has setup_server.py, run it once, with the same terminal still open:

Windows

python setup_server.py

Mac / Linux

python3 setup_server.py
  • It prints each role, channel and message as it makes it, and finishes with “Done!”.
  • It’s safe to run again. It skips what already exists.
  • It may create state.json, which remembers what it built. Keep that file next to the bot.

Then in Discord, open Server Settings → Roles and make sure the bot’s own role is at the top, above the roles it needs to give out. After that, give yourself the Owner role if your bot made one. Everything it built is yours to rename, move or delete.

12Start the bot

Windows

python bot.py

Mac / Linux

python3 bot.py

You should see a line like Logged in as YourBot#1234. Your bot is now online in the member list. Try one of its slash commands in your server. Type / and a list pops up. Your README lists them.

  • The bot only works while this window stays open and the program is running.
  • To stop it, press Ctrl + C in the window (or just close it).
  • If you didn’t activate the private box, you can run the bot straight from it instead. Windows: .venv\Scripts\python bot.py. Mac / Linux: .venv/bin/python bot.py.

The easy way

If your zip has start-bot.bat (Windows) or start-bot.command (Mac), just double-click it. The first time it sets up the private box and installs the add-ons for you, and afterwards it starts the bot and restarts it if it stops. Make your .env first (Step 9). On a Mac, if it won’t open, right-click it and choose Open, or run chmod +x start-bot.command once in Terminal.

13Keep it online 24/7

A Discord bot is only online while its program is running. When the program stops, the bot goes offline and its buttons stop working. You have three options:

Option 1: your own computer (free)

Leave the bot running (use start-bot if you have it). It goes offline when the computer sleeps, restarts or shuts down. Turn off sleep in your power settings if you want it always on.

Option 2: a small rented server (a VPS)

A VPS is a small Linux computer you rent, usually for a few dollars a month. Pick Ubuntu, log in over SSH, and run:

sudo apt update && sudo apt install -y python3 python3-venv python3-pip tmux
# copy your bot folder to the server (scp, WinSCP or FileZilla), then:
cd MyBot
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt
tmux new -s mybot
.venv/bin/python bot.py

Press Ctrl + B, then D to leave it running in the background. To come back later: tmux attach -t mybot. tmux doesn’t restart the bot after the server reboots. For that, ask your host about a “systemd service”, or use a bot host.

Option 3: a bot host or game-panel host

Many hosts made for Discord bots let you upload files and press Start. Typically you:

  1. Create a Python server.
  2. Upload the whole bot folder (or the zip, and use Unarchive). Make sure .env and state.json (if you have one) are included.
  3. Set the start file to bot.py and the requirements file to requirements.txt. Or set the startup command to pip install -r requirements.txt && python bot.py.
  4. Click Start.

Tip: run setup_server.py once on your own computer first (Step 11), then upload the folder with its state.json.

Whichever you choose, keep the bot’s folder together. state.json and the data/ folder hold your server’s IDs, levels and other saved data.

14Change the text and settings later
  • Texts: if your zip has a content/ folder, edit those .md files in any text editor (they hold things like your welcome and rules text). If your bot has setup_server.py, run python setup_server.py --update-messages afterwards to refresh the messages it already posted.
  • Names, timezone and options: they’re in your .env file when your bot supports them. The notes in the file explain each one.
  • After you change any file, restart the bot (stop it with Ctrl + C and start it again).

Want something changed that isn’t in a setting? Your order includes revisions. Check your package on the pricing page.

15Troubleshooting

Find your error message below, or use the search box at the top of the page.

“Fill in DISCORD_TOKEN … in .env first”

The bot can’t find your settings. Check that the file is named exactly .env (not .env.txt), that it’s in the same folder as bot.py, and that DISCORD_TOKEN= (and GUILD_ID=) have values after the equals sign.

“Improper token has been passed” or a LoginFailure

The token was copied wrong. Go to the Developer Portal → Bot → Reset Token, copy the new one, and paste it into .env with no spaces and no quotes. Save the file and start the bot again.

“PrivilegedIntentsRequired” or “Shard ID None is requesting privileged intents”

You skipped Step 3. In the Developer Portal → Bot, switch on Server Members Intent and Message Content Intent, click Save Changes, and start the bot again.

“python is not recognized” / “command not found: python”

Windows: reinstall Python and tick Add python.exe to PATH, then open a new terminal. You can also try py instead of python. Mac / Linux: use python3 instead of python.

“ModuleNotFoundError: No module named ‘discord’” (or dotenv)

The add-ons aren’t installed, or the private box isn’t switched on in this terminal. Run the activate line from Step 10 (you should see (.venv) at the start of the line), then pip install -r requirements.txt again. Or run the bot with .venv\Scripts\python bot.py (Windows) / .venv/bin/python bot.py (Mac / Linux).

Windows says “running scripts is disabled on this system”

That happens in PowerShell. Open Command Prompt instead (press the Windows key, type cmd, press Enter, then cd to your bot folder), or skip activate and use .venv\Scripts\python -m pip install -r requirements.txt and then .venv\Scripts\python bot.py.

Linux says “ensurepip is not available” or the venv won’t create

Install the venv tools: sudo apt install -y python3-venv python3-pip, delete any half-made .venv folder, and run Step 10 again.

Slash commands don’t show up

Check three things: (1) you invited the bot with the link from Step 5, which includes applications.commands (invite again with that link if unsure, it won’t hurt); (2) the bot is running and shows Logged in as…; (3) GUILD_ID is the ID of the server you’re looking at. Then restart the bot, wait a minute, and refresh Discord with Ctrl + R (Cmd + R on Mac).

Roles can’t be given / “Missing Permissions”

The bot’s role has to sit above every role it hands out. Open Server Settings → Roles and drag the bot’s role up (to the top is easiest). It also needs the Manage Roles permission, which the invite link in Step 5 already includes. If you used an automatic role, double-check the AUTO_ROLE_ID number too.

“I’m not in a server with ID…”

GUILD_ID is wrong, or the bot was never invited to that server. Copy the server ID again (Step 6) and use the invite link from Step 5 for that server.

Buttons say “This interaction failed”

The bot isn’t running (or it crashed). Look at the bot’s window for an error, then start it again.

The bot shows as offline

The program isn’t running. It stops when you close the window, and your computer sleeping or shutting down stops it too. Start it again, or see Step 13 to keep it running all the time.

My .env file doesn’t seem to work

Windows Notepad likes to save .env as .env.txt. In File Explorer turn on View → Show → File name extensions and rename it to .env. In Notepad choose Save as, set the type to All files, and name it .env.

Still stuck? Send us a message on your order and tell us the exact error line from the bot’s window (copy and paste it, but never include your token).

16Stay safe
  • Never share your token or your .env file. If anyone asks you for your token, say no. Nobody needs it to help you.
  • Reset the token (Developer Portal → Bot → Reset Token) if you ever paste it somewhere by mistake, then update .env.
  • Don’t upload .env or state.json to GitHub or any public place.
  • Only give powerful roles (Owner, Admin) to people you fully trust, because the bot’s admin tools follow your roles.
  • If your bot makes backups in a backups/ folder, copy that folder somewhere else now and then. A backup on the same computer won’t help if that computer breaks.
  • Ask a parent or guardian before you rent a server or add a payment method anywhere.

Still stuck? Ask us in our Discord.

All done? Your bot is live.

Want to see what else a bot can do, or add more features?