Help Center

Get your bot ready before you upload

The five checks that prevent most deployment problems.

Quick steps

  1. Test the bot on your own computer first and make sure it starts without errors.
  2. Never put your bot token in the code. Read it from an environment variable and add it in the bot settings on Hartwell.
  3. List every dependency in package.json (Node.js), requirements.txt (Python) or the equivalent for your language.
  4. Know your start file, such as index.js or main.py. You enter it as the Startup File when you create the bot.
  5. Save data you need to keep in files or a database. Files inside the bot folder stay between restarts, but treat memory as temporary.
  6. Then follow Deploy your first bot.

Reading the token from the environment

In Node.js, read the token with process.env.DISCORD_TOKEN. In Python, use os.environ["DISCORD_TOKEN"]. Then add a variable with the same name in your bot settings on Hartwell. The name is up to you, but it must match exactly.

Dependency files by runtime

  • Node.js and Bun: package.json
  • Python: requirements.txt
  • Java: the built .jar file
  • Go: go.mod
  • Rust: Cargo.toml, or the built program
  • Deno: deno.json
  • PHP: composer.json
  • .NET: the built .dll
  • Ruby: Gemfile

Handling restarts

Bots restart when you update them, when the platform is maintained, or after a crash. Save anything important to a file or a database rather than keeping it only in memory, and make sure your bot reconnects cleanly on start.

Never share your password, a bot token, a private key or card details with anyone, including Hartwell staff.

Related articles

Still stuck? Open a support request from your dashboard, or use /support in the Hartwell Discord server.

← All help articles