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
- Reset the token at Discord or Telegram. The old token stops working right away.
- Copy the new token. Discord shows it once.
- In the Bothosting app, open the deployment, then Token & variables. Replace
BOT_TOKENorTELEGRAM_BOT_TOKENand save. - Tap Restart and open Logs. A clean login confirms the new token.
- 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.