Phones and mobile apps2 minutes to read

My bot token leaked. How do I fix it from my phone?

Reset the Discord or Telegram token, save the new one in the Bothosting app and restart, in about two minutes, before anyone can use the leaked one.

Reset the token, save the new one, restart

Reset the token first, because the reset is what locks the leaked token out. For Discord, open the Developer Portal in your phone’s browser, go to your application’s Bot page and tap Reset Token. For Telegram, send /revoke to BotFather in the Telegram app and pick the bot. Then open the deployment in the iOS app or the Android app, paste the new token in Token & variables and tap Restart.

Do the steps in this order

  1. Reset the token at Discord or Telegram. The old token stops working right away.
  2. Copy the new token. Discord shows it once.
  3. In the Bothosting app, open the deployment, then Token & variables. Replace BOT_TOKEN or TELEGRAM_BOT_TOKEN and save.
  4. Tap Restart and open Logs. A clean login confirms the new token.
  5. Check your servers or chats for messages the bot sent while the token was exposed.

Find where it leaked

Most leaks come from a token committed to a public GitHub repository, a screenshot of a config file, or a log pasted into a chat. If it was committed, deleting the file isn’t enough, because the old commit still holds it. The reset is what makes you safe. Then move the token out of the code so it’s read from the environment. Discord scans public GitHub repositories and may reset a token it finds, which is why a bot can stop logging in right after a push.

Stop it happening again

Keep tokens only in Variables, never in files you push to GitHub. Before you share Logs, check the copied lines for anything that looks like a token. See keeping a bot token secret.