Bot hosting

Start, stop and the console

The buttons at the top of your bot's page start, stop and restart it. The Console tab shows what it prints.

What happens on Start #

  1. If package.json or requirements.txt is in the top folder, its packages are installed. The bot shows as starting until they are in. The first start, or one after you add a package, can take a minute or two.
  2. Your start file runs with your variables in its environment.
  3. The console prints Starting your bot: followed by the start file's name, and then whatever your bot prints.

If there is no start file in the top folder, nothing runs: the bot stays stopped and the console tells you to upload it first. Check the file's name under Startup on the Manage tab.

Stop and Restart #

Stop sends your bot the same signal as pressing Ctrl+C in a terminal, so it can log out of Discord cleanly if it handles that. Restart stops it and starts it again, installing packages again on the way.

The console #

The console shows your bot's output as it prints it, and has a line at the bottom to send the running bot a command, if your bot reads from its standard input.

  • It is live only while the tab is open, and a bot can have at most five people watching at once.
  • A stopped bot's console shows its last output if the console was open, or the bot was started, in the two minutes before it stopped. Otherwise it starts empty: the output of an earlier run is not kept. Keep the tab open while you test a change.
  • Color codes meant for a terminal are removed.

If your bot crashes #

A bot whose program ends, or crashes, shows as stopped. It is started again once by itself. If it crashes again within a minute, it is left stopped so that a broken bot does not loop for ever: read the console, fix the cause, and start it.

Common causes of a bot that will not start #

What you see What it usually means
"There is no index.js here yet" The start file is missing or named differently. Fix the name on the Manage tab, or move the file to the top folder
Cannot find module or ModuleNotFoundError The package is not in package.json or requirements.txt. Add it and restart
An invalid token was provided or 401 The token in Variables is wrong, or was reset in the Developer Portal
Used disallowed intents Turn the intent on under Bot in the Developer Portal
Stops without an error, straight away The start file ran to its end. A bot has to keep running: check that it logs in and waits
Stopped after running for a while Most often memory: the bot went over the plan's figure. Look for what grows, or move to a bigger plan

If you are stuck, open a support ticket and say what the console printed. We can look at your bot's files and console with you, but not at your variables.