Sync Bot — Server Mirroring

Setup

Create the bot, invite it to both servers and host it on Pterodactyl (Node 22).

Setup

1. Create the Discord bot

  1. Create an application in the Developer Portal.
  2. Under Bot, add a bot and copy the token.
  3. Under Bot → Privileged Gateway Intents, enable the Message Content Intent.
  4. Copy the Application ID from General Information (used as CLIENT_ID).
The Server Members intent is not needed. Message Content is required; Server Message Reactions is not privileged and needs no extra toggle.

2. Invite the bot — to both servers

Invite the bot with an OAuth2 URL using the scopes bot and applications.commands. Required permissions: Manage Channels, Manage Webhooks, View Channels, Send Messages, Read Message History.

The bot must be on both Server A and Server B. If it is missing on either one, /sync activate will fail.

3. Hosting on Pterodactyl (Node 22)

  1. Set the egg's Node version to 22. Node 18 is not supported.
  2. Upload the source code — without node_modules (it is installed fresh on the server).
  3. Set the environment variables:
VariableDescription
DISCORD_TOKENBot token from the Developer Portal
CLIENT_IDApplication ID
JS_FILEdist/index.js — the startup runs dist/${JS_FILE}
DATABASE_PATHOptional, defaults to ./data/sync.db

On boot it automatically runs: npm installnpx tsc -p (compiles to dist/dist/) → node dist/dist/index.js.

Point DATABASE_PATH at a persistent path (e.g. ./data/sync.db). If the database is lost, the bot no longer recognises its own webhooks — which can cause infinite loops.

4. Run locally (optional)

cp .env.example .env   # add token + client id
npm install
npm run dev

5. Slash commands

The /sync commands are registered automatically — on startup for every server the bot is in, and instantly whenever the bot joins a new server. There is nothing to deploy manually.

Next, head to Commands — that's where you learn how to start a sync.
Copyright © 2026