Smile Corp Docs
Français
Dépannage
Cette page n'a pas encore été traduite en français, elle est donc affichée en anglais.

Invalid token

Your Discord bot can't log in because its token is wrong, missing or has been reset.

Mis à jour le 12 sept. 20261 min de lecture

You’ll see one of these in the console:

Error [TokenInvalid]: An invalid token was provided.
discord.errors.LoginFailure: Improper token has been passed.

Discord refused to log your bot in. The token your code sent isn’t a valid, current one.

Fix it

  1. Go to the Discord Developer Portal, open your application and go to Bot.
  2. Click Reset Token and copy the new one.
  3. On Smile Hosting, open your server’s Files tab and paste it into wherever your code reads it - usually .env (TOKEN=...) or config.json. Click Save.
  4. Press Restart on the Console tab.

Common causes

  • The token was reset. Discord resets tokens itself if it spots one posted publicly, for example in a GitHub repository. Your old token stops working the moment that happens.
  • Extra characters. A space, a line break, or quote marks copied along with the token.
  • The wrong thing was copied. The Application ID and Public Key on the General Information page are not the token - it’s only on the Bot page.
  • The file isn’t being read. If you use .env, check the file is named exactly .env and your code loads it (require('dotenv').config() or load_dotenv()).
Danger

Never share your token with anyone - including us. If you think it’s leaked, reset it straight away.