Keeping your bot online
A bot is online only while its start command is running. Closing the terminal stops the bot, and so does a computer going to sleep. These instructions are also included in your README.md in your exported zip file :)
flowchart LR
accTitle: From DisFlow to a running bot
accDescr: Export the bot from DisFlow, upload it to a computer or host, add the token, install and start it.
Project["DisFlow project"] --> Export["Export ZIP"]
Export --> Host["Computer or host"]
Host --> Token["Add DISCORD_TOKEN"]
Token --> Start["npm install and npm start"]
Start --> Online["Bot online"]
Choose where it runs
Section titled “Choose where it runs”| Option | Good for | Keep in mind |
|---|---|---|
| Your own computer | Testing and small personal bots | The computer must stay on and awake |
| A hosting service | Bots that should always be online | Usually a monthly cost or a free tier with limits |
| A VPS | Full control | You manage updates, security and restarts |
On your own computer
Section titled “On your own computer”- Unzip your exported bot into a folder.
- Run
npm installonce. - Add your token to
.env. - Run
npm start.
Leave the terminal open. If the computer sleeps, the bot goes offline until it wakes up.
For a more permanent setup you can run the bot under a process manager that restarts it after a crash, but for most people a hosting service is simpler.
On a hosting service
Section titled “On a hosting service”The exact buttons differ between providers, but the steps are the same:
-
Create a Node.js 18+ app or service and upload the unzipped bot files, or connect a Git repository containing them.
-
Set the install command to:
Terminal window npm install -
Set the start command to:
Terminal window npm start -
Add environment variables in the host’s settings:
DISCORD_TOKEN=your-bot-tokenAdd any other variables you exported from DisFlow here too. Do not upload the
.envfile itself. -
Start the service and open its logs. Watch the first few lines for errors; if the process exits immediately, the log usually names the problem.
Popular options include Railway, Render, Fly.io and a small VPS. Free tiers often sleep idle apps, which takes the bot offline until it is woken.
Updating your bot
Section titled “Updating your bot”- Change and save the graph in DisFlow.
- Select Export bot.
- Replace the bot files on the computer or host.
- Run
npm installif the export added new dependencies. - Restart the bot.
Keep these rules in mind
Section titled “Keep these rules in mind”- Run each bot token in one place at a time.
- Keep
.envprivate — it contains your token in plain text. - Check the logs after every update.
- Test changes on a small server before using them in a busy one.