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
- Create an application in the Developer Portal.
- Under Bot, add a bot and copy the token.
- Under Bot → Privileged Gateway Intents, enable the Message Content Intent.
- 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)
- Set the egg's Node version to 22. Node 18 is not supported.
- Upload the source code — without
node_modules(it is installed fresh on the server). - Set the environment variables:
| Variable | Description |
|---|---|
DISCORD_TOKEN | Bot token from the Developer Portal |
CLIENT_ID | Application ID |
JS_FILE | dist/index.js — the startup runs dist/${JS_FILE} |
DATABASE_PATH | Optional, defaults to ./data/sync.db |
On boot it automatically runs: npm install → npx 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.