D Darkless Help
Open the portal

Help Game servers Discord bots

Host a Discord bot

Put your bot's code on the panel, keep its token secret, start it, read its logs, and keep it online. For Node.js and Python bots.

5 min Updated 7 Nov 2026 Discord bots

A bot on the game panel is a small server that runs your code around the clock. You put the code on it, tell the panel which file to run, and start it. This guide uses Node.js and Python, the two most common, and works the same way for others.

Before you start#

You need a bot made in the Discord Developer Portal, with its token, and the bot invited to your Discord server. The token is the bot's password: whoever has it can act as your bot.

If your bot reads what people type, also turn on Message Content Intent under the bot's settings in the Developer Portal. Without it, the bot sees messages but not their text.

1. Check how your bot server starts#

On the panel's Startup tab, the settings under the startup command are yours to change:

SettingSet it to
The file it runsYour bot's main file, such as index.js or bot.py
Docker Image, if there's a choiceThe language version your code is written for
Packages or a requirements file, if listedInstalled on every start from package.json or requirements.txt
A Git repository, if listedYour repository, to fetch the latest code on each start

2. Put your code on it#

Upload your project's files into the top folder of the server, with the Files tab or over SFTP (see Upload files over SFTP).

Leave out the folders that get made from your dependency list:

  • For Node.js, don't upload node_modules. Upload package.json and package-lock.json, and the packages are installed on the server.
  • For Python, don't upload a venv folder. Upload requirements.txt.

Packages built on your computer may not work on the server, which is why it installs its own.

3. Keep the token out of your code#

Don't write the token into your code, and never commit it to Git. Put it in a file called .env in the server's top folder, made in the Files tab:

DISCORD_TOKEN=paste-your-token-here

Then have your code read it from there.

Node.js

Add dotenv to your package.json dependencies, and at the very top of your main file:

require('dotenv').config();

Then use process.env.DISCORD_TOKEN wherever you need the token, for example client.login(process.env.DISCORD_TOKEN).

On Node.js 20.6 or later you can skip dotenv and have Node read the file itself, if your startup command lets you add --env-file=.env.

Python

Add python-dotenv to your requirements.txt, and near the top of your main file:

import os
from dotenv import load_dotenv

load_dotenv()

Then use os.getenv("DISCORD_TOKEN") wherever you need the token, for example bot.run(os.getenv("DISCORD_TOKEN")).

If your project is in Git, add .env to your .gitignore so it never goes into the repository.

4. Start it and read the logs#

Press Start on the Console tab. The console shows everything your bot prints: installing packages, logging in, and any error. A bot that has connected usually prints a line saying so, if you wrote one, and appears online in Discord.

Print useful lines in your code, such as Logged in as ... and a line for each error you catch. They are the only window you have into a bot running on its own.

5. Keep it online#

The bot runs for as long as the server is running, with nobody signed in. A few things keep it that way:

  • Catch errors in your commands and event handlers, so one bad message doesn't end the whole program.
  • Let your library reconnect. discord.js and discord.py both reconnect after a dropped connection by themselves, so don't add your own loop that logs in again.
  • Restart it on a schedule if it slowly uses more memory the longer it runs. A daily restart at a quiet hour is one task: see Schedule restarts and backups.
  • Watch the memory on the Console tab. If it climbs to the plan's limit, the bot is stopped. Find what keeps growing, such as a cache that never empties, or move to a bigger plan.

Common errors#

  • TokenInvalid, 401 Unauthorized or Improper token: the token is wrong, has a space or quote around it in .env, or was reset. Copy it again from the Developer Portal.
  • Cannot find module or ModuleNotFoundError: a package isn't in package.json or requirements.txt, so it wasn't installed. Add it and restart.
  • Used disallowed intents: the code asks for an intent that isn't turned on in the Developer Portal. Turn it on there, or remove it from the code.
  • The bot is online but answers nothing: check Message Content Intent, and that the bot has permission to read and send messages in that channel.
  • It starts the wrong file: check the main file setting on Startup.

Still stuck? Open a ticket and say which guide you followed.