НОВОЕ 📢 Сэкономьте до 30% в первый месяц, ограниченное предложение!

Why your Discord bot keeps stopping

Discord bot hostingUpdated Oct 6, 20264 min read

Start with the console. Open your server in the panel, go to Console and read the last lines before the bot stopped. Almost every case shows its cause there.

How automatic restart works

When your bot exits unexpectedly, the server starts it again once. If it exits again within one minute, the server stays stopped on purpose. That stops a bot with a bug from restarting forever. Fix the cause shown in the console, then start the server yourself.

A bot that runs for a long time and then crashes is restarted every time, because the one-minute rule only applies to quick repeated crashes.

Common causes

The server stops straight away with "Cannot find module" or "ModuleNotFoundError"

Why: a package your bot needs is not installed. Fix: for Node.js check that package.json lists it, or add it in the Extra npm packages field. For Python add it to requirements.txt or the Extra pip packages field. Restart the server, packages install on every start.

"Cannot find file", "No such file" or the main file is not found

Why: the Main file or Jar file setting does not match the real file name. File names are case sensitive. Fix: open Settings, then Game Settings, and make the name match exactly, including any folder (for example src/bot.js).

Login error, "invalid token" or "disallowed intents"

Why: the token is wrong or was reset, or your bot asks for an intent that is not switched on in the Developer Portal. Fix: copy a fresh token into Discord bot token, and switch on the intents your bot uses under Bot in the Portal.

The server stops after a while and the console ends with "killed"

Why: the bot used more memory than the plan has. Fix: reduce what the bot caches, or move to a plan with more memory. As a guide, small bots need 128 to 256 MB, music or a database 256 to 512 MB, and large bots 512 MB to 2 GB.

The bot is online in the console but offline in Discord

Why: a second copy of the bot is logged in with the same token elsewhere, or the bot is stuck before it logs in. Fix: stop the other copy (your computer or an old host), then restart this server.

Python output is missing from the console

Why: Python holds back output when it is not on a terminal. Fix: use print("text", flush=True) or the logging module.

If none of these fits, send support the last 30 lines of the console. See How to fix a server that will not start.

СОЗДАЙТЕ СВОЙ ИГРОВОЙ СЕРВЕР
ГОТОВЫ НАЧАТЬ?

Сэкономьте до 30% на вашем новом игровом сервере.
Премиальная производительность, мгновенная активация и непревзойдённая надёжность по лучшей цене.

ПОСЛЕДНИЕ БЛОГИ