Common Discord bot errors

The Discord bot errors we see most, and how to fix them.

Most errors show up in the Terminal when your bot starts. Find the first error and match it below.


Invalid Token

Errors like "An invalid token was provided" or "Improper token has been passed" mean the token is wrong, has a space or quote in it, or was reset. Copy a fresh one from the Discord Developer Portal. See Keeping your bot token safe.


Used Disallowed Intents

Your code asks for a privileged intent that isn't turned on. In the Discord Developer Portal, open your application, go to Bot, and turn on the intents your bot uses (Server Members, Presence or Message Content).


Cannot Find Module / ModuleNotFoundError

A package isn't installed, or your main file setting points at the wrong file.

  • Node.js: check the package is in package.json, and that Main file on the Startup page is right.

  • Python: add the package to requirements.txt, and check App py file.

See Installing packages for your bot.


Syntax Errors on Code That Works Elsewhere

Your bot may need a newer language version. Change it under Docker Image on the Startup page, then restart.


Bot Is Online but Doesn't Respond

  • Make sure the Message Content intent is on if your bot reads messages.

  • Check the bot has permission to see and send messages in that channel.

  • Check the Terminal for errors when you use a command.


Bot Keeps Crashing

Check the error just before it stops. If memory is at its limit on the Terminal page, your bot needs more RAM. See My server is lagging or crashing.

Still stuck? Open a ticket in the Technical department and paste the error. Fixing your bot's own code is up to you, but we're happy to point you in the right direction. See What our support covers.


Related Articles

Was this article helpful?

Your feedback helps us improve the documentation. Thanks — we’re glad this article helped. Sorry about that. What were you hoping to find? Thanks — we’ll use your feedback to improve this article.