CoreX Hosting

Save your bot token and other secrets

Where do I put my bot token, and is it safe?

Under Environment in your bot's panel. Saved values are hidden in the panel, but your bot and people with code, console, SFTP, backup or hosting infrastructure access may be able to read them. Share access only with people you trust.

Before you start: Your bot's token from the Discord Developer Portal (Bot > Reset Token if you no longer have it).

Step by step

  1. Open your bot in the client area and click Environment in the sidebar.
  2. In Name, type exactly what your code reads, for example DISCORD_TOKEN. Names use letters, digits and underscores.
  3. Paste the token into Value and click Save variable. The list then shows the name with the value hidden.
  4. In your code, read it from the environment: process.env.DISCORD_TOKEN in Node.js, or os.environ["DISCORD_TOKEN"] in Python. Remove any token written directly in the code.
  5. Restart the bot so it starts with the new variable. To change a value later, save it again under the same name; to delete one, click Remove.
  6. If a token was ever posted somewhere public, reset it in the Discord Developer Portal first, then save the new one here.

Check it worked: The variable is listed under Saved variables and your bot logs in after a restart.

Why it happens: A token in your code or in a file you share is easy to leak; an environment variable keeps it out of both.

CoreX staff never ask for your token or your Discord password. If someone claiming to be CoreX asks for either, do not send it, and report it to support.

More guides on Discord bot hosting: