ACLClouds
ACLClouds

The bot refuses to connect: token missing or invalid

Check the variable name, that the secret is set and the Discord permissions, without exposing it in the logs.

A token may be valid but never read if the code expects DISCORD_TOKEN while the panel defines TOKEN. It must remain in a secret variable, never in the repository.

Step-by-step procedure

  1. Check the exact name

    Locate process.env.DISCORD_TOKEN or os.getenv("DISCORD_TOKEN") then use the exact same key.

  2. Remove spaces and quotes

    Paste only the token value. Do not surround it with quotes in the panel field.

  3. Reset it if exposed

    If the token appears in a log, a screenshot or Git, reset it immediately in the Discord Developer Portal.

  4. Check the privileged intents

    An error related to privileged intents is fixed in the Discord Developer Portal and in your code, not by changing the token.