This guide covers how to set up and run Discord bots provided by Nexus Development. All bots are built with Node.js and require a hosting environment to stay online 24/7.

Requirements

  • Node.js 18+ installed on your server
  • A Discord Bot Token from the Discord Developer Portal
  • npm or yarn package manager
  • A process manager like PM2 (recommended) or screen
  • Git (optional, for cloning repositories)

Step 1 — Download the Bot

After purchase, download the bot files from your BuiltByBit account or the delivery DM. Extract the ZIP to a folder on your server.

Step 2 — Install Dependencies

Open a terminal in the bot folder and run:

npm install

This installs all required packages listed in package.json.

Step 3 — Configure the Bot

Create a .env file in the bot root (or edit config.json depending on the bot):

VariableDescription
TOKENYour Discord bot token
CLIENT_IDYour bot's application ID
GUILD_IDYour Discord server ID (for slash command testing)
PREFIXCommand prefix for message-based commands
MONGO_URIMongoDB connection string (if the bot uses a database)

Step 4 — Register Slash Commands

Run the deploy command once to register commands with Discord:

node deploy-commands.js

This only needs to be done when commands change, not on every restart.

Step 5 — Start the Bot

For testing:

node index.js

For production (runs in background, auto-restarts on crash):

npm install -g pm2
pm2 start index.js --name "nexus-bot"
pm2 save
pm2 startup

Step 6 — Invite the Bot

In the Discord Developer Portal, go to OAuth2 > URL Generator:

  • Scopes: bot, applications.commands
  • Permissions: Select the permissions your bot needs (usually Administrator for full functionality)
  • Copy the generated URL and open it in your browser to invite the bot to your server

Updating the Bot

To update to a new version:

  1. Back up your .env or config.json
  2. Replace the bot files with the new version
  3. Run npm install to update dependencies
  4. Run node deploy-commands.js if commands changed
  5. Restart with pm2 restart nexus-bot
Need Hosting?Use our affiliate link and code NEXUS for 15% off your first purchase at ReviveNode. Their VPS plans work great for Discord bots.
Never commit your .env file or token to Git. Add .env to your .gitignore if using version control. Exposed tokens are automatically scanned and disabled by Discord.