Help Center
Get your bot ready before you upload
The five checks that prevent most deployment problems.
Quick steps
- Test the bot on your own computer first and make sure it starts without errors.
- Never put your bot token in the code. Read it from an environment variable and add it in the bot settings on Hartwell.
- List every dependency in package.json (Node.js), requirements.txt (Python) or the equivalent for your language.
- Know your start file, such as index.js or main.py. You enter it as the Startup File when you create the bot.
- Save data you need to keep in files or a database. Files inside the bot folder stay between restarts, but treat memory as temporary.
- 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
- Deploy your first bot From an empty pool to a running bot.
- Keep your bot token safe How to protect your token and what to do if it leaks.
- Which bot runtime should I pick? Node.js, Python, Java, Go, Rust, Bun, Deno, PHP, .NET or Ruby, and how to choose.
Still stuck? Open a support request from your dashboard, or use /support in the Hartwell Discord server.