bot token

Exposed Discord Bot Token? Here's how to detect and rotate it

Leaked a Discord bot token? Reset it in the Developer Portal in under a minute, then check a few settings. Scan your repo free with Trust for other copies.

A Discord bot token is the single credential that authenticates your bot to Discord, and it carries every permission the bot has been granted. Anyone with the token controls your bot completely - there is no per-request check beyond the token itself. A leaked token means immediate, full bot takeover until you reset it.

What an attacker can do with a leaked Discord Bot Token

How Discord Bot Tokens get exposed

Scan your repo for exposed Discord Bot Tokens - free

Trust checks the files in your repo and the JavaScript your site ships. No signup, results in about a minute.

Run a free scan →

How to rotate a leaked Discord Bot Token

  1. Go to discord.com/developers/applications and open your application.
  2. Click the Bot tab in the left sidebar.
  3. Click Reset Token, confirm, and enter your 2FA code if prompted - the old token is invalidated instantly and any running instance disconnects.
  4. Copy the new token once and store it in your environment or secrets manager, never in code.
  5. Redeploy or restart your bot with the new token to bring it back online.
  6. Open each server's Server Settings → Audit Log and review recent actions for bans, deletions, or role changes you did not make.

Open the Discord Bot Token dashboard →

Make the next slip smaller

  • Give the bot only the permissions it needs. Avoid the Administrator permission.
  • Turn on privileged intents (members, presence, message content) only if your bot really uses them.
  • Keep the token in an environment variable on your host, never in a file you commit.
  • Use a separate bot for testing, so a test token never touches your real servers.

How Trust helps

Trust's repo scan has a rule for common Discord bot token formats, so it may catch one in your files before you push or share the repo.

Other secret types to check

Keep your app safe