Fix TOKEN_INVALID

RunUpdated

An invalid token prevents your bot from logging in to Discord. You might see TOKEN_INVALID, TokenInvalid, or a login failure in the console. The bot can start as a process while remaining offline in Discord.

Check the saved value

  1. Stop the bot so it does not keep retrying the same credentials.
  2. Open your application in the Discord developer portal and choose Bot.
  3. Reset the token if you no longer have its value or suspect it was shared.
  4. On your bot page, open Variables and paste the token into Bot token. Save and restart.

Use the bot token from the Bot section. An application ID, public key, client secret, or OAuth access token is a different value. Paste only the token, without quotes, spaces, or a Bot prefix.

Check your code

Read BOT_TOKEN from the environment. Node uses process.env.BOT_TOKEN; Python uses os.environ["BOT_TOKEN"]. Check that a local configuration file is not overriding that variable with an old value. Do not print the token while debugging. Log whether a value exists instead.

If it still fails

Check that you saved the token on the same server you are starting. Resetting a token invalidates the previous value, so update any other trusted copy. Avoid repeatedly restarting until you have corrected the value. If the next failure mentions privileged intents or permissions, follow that error separately; another token reset will not fix it.

Never send a token to support or post it in a screenshot. Share the error text with credentials removed. See variables and tokens for code examples and the deployment docs for your runtime.

Still stuck? Contact support