Skip to main content

Running Your Bot

DisFuse writes your bot's code. Something has to run it, and that something is a host: a computer that stays on, all the time, with your bot's files on it.

Export your bot​

Click Export in the editor toolbar.

The export dialog

You choose two things:

  • Version, if your project uses Version Control.
  • What to include: the whole version, with every workspace, or just the one you are looking at.

Export the whole thing unless you are deliberately testing one workspace on its own.

Click Download ZIP.

Node.js or Bun​

The dialog says what the export is set up for, such as "Exporting for Node.js with npm". That decides the start command in package.json and the commands in instructions.txt.

Change it in Settings > Export, or for just one bot in its project settings. With Bun, the start command is bun index.js and dotenv is left out, because Bun reads .env by itself.

Download only the code​

Already have your bot set up on a host? Click Download file instead of Download ZIP. You get just index.js, the bot's code, with no ZIP to extract and delete afterwards. Replace the old index.js on your host with it.

This is only for updating a bot that already runs. index.js alone has no package.json or .env, so a first export needs the ZIP. If you added blocks that need a new library, export the ZIP again so package.json lists it.

info

The exported files are a snapshot. Change your blocks and you have to export again and re-upload, or your host keeps running the old code.

What is in the ZIP​

FileWhat it is
index.jsYour bot, as JavaScript.
package.jsonThe list of libraries it needs.
.envYour bot token and your secrets.
instructions.txtA short guide to getting it running.
danger

The .env file contains your real bot token. Never upload the ZIP anywhere public, never put it in a GitHub repository, and never send it to somebody who should not be able to control your bot.

Choose a host​

Your bot needs Node.js, version 18 or newer, or Bun if you exported it for Bun.

Free hosts. Fine for testing and small bots. Expect limits: they may sleep when idle, cap your memory, or wipe files on restart.

wispbyte.com

solarhosting.cc

fps.ms

discloud.com

Paid hosts. More reliable, and worth it once people depend on your bot.

wispbyte.com (paid plans)

replit.com

heroku.com

Any VPS provider, if you are comfortable with a terminal.

warning

If your bot uses the Databases or Files blocks, check that your host keeps files between restarts. Some free hosts do not, and your data will vanish every time the bot restarts.

Get it running​

Every host is different, but the shape is always the same:

  1. Unzip the download.
  2. Upload the files to your host.
  3. Install the dependencies. Most hosts do this for you; otherwise run npm install (or pnpm install, yarn install or bun install, matching your package manager).
  4. Set the start command to node index.js (bun index.js for Bun), or npm start if your host prefers it.
  5. Start it.

Some hosts ignore .env files and want environment variables set in their own panel. If your bot starts but the token is missing, that is the reason. Copy each name and value across by hand.

Checking it worked​

Your bot's status in Discord turns from offline to online. If you set a presence with the Main blocks, it appears under the name.

If it does not come online, read your host's console. The error is almost always in the first few lines.

MessageMeans
An invalid token was providedThe token in .env is wrong or has been reset.
Used disallowed intentsPrivileged intents are off in the Discord Developer Portal. See Creating a bot.
Cannot find moduleThe dependencies were not installed. Run npm install.
Nothing at allThe start command is wrong, or the host is not running it.

More in Troubleshooting.

Keeping it running​

  • Re-export after every change, and re-upload. There is no automatic deployment.
  • Watch the console after an update. A bot that starts fine can still fail on the first command.
  • Use Insights to see what your bot is actually doing across every server it is in, without reading logs.
  • Use Control to act as your bot from the DisFuse website.

Getting help​

If your bot will not start, join the DisFuse Discord server and post in the support channel. Include the error from your host's console and the name of the host. That is usually enough for somebody to spot it immediately.