Requirements
Dependencies are
discord.js, mineflayer, prismarine-auth and dotenv; npm install handles them.
nodemon is a development dependency used only by npm run dev, so a server that just runs the bot can
install with npm install --omit=dev.
The bot account is a real account. It sits in the guild, it can be muted by Hypixel’s spam filter, and it is subject to the server rules like any other. Use an account you are willing to have doing this.
Steps
-
Clone the repository
-
Install dependencies
-
Create the
.envfile in the project root. Copy.env.exampleand fill it in:See Configuration for every variable and what it does; the minimum is: - Invite the bot to your Discord server with the permissions listed in Permissions.
-
Start it
-
Complete the Microsoft sign-in. On a fresh install the account in
MINECRAFT_USERNAMEis registered as the first Hypixel guild and a device-code flow opens in the console: a link and a code. Open the link, enter the code, and sign in as that account. Tokens are cached in.minecraft-auth/, one entry per account, so this happens once per account. -
Set the admin roles.
Until a role is added, only someone with the Discord Administrator permission can run
/adminroleitself, and nothing else admin-gated will work. See Admin roles.
Checking it worked
Adding more Hypixel guilds
Everything after the first guild is done from Discord, not from the.env:
Where TriBridge keeps its files
Everything is written next to the repository, in the project root, and every one of those files is gitignored. See Config files for what each holds. They survive agit pull, which is what makes
updating a two-command job.
Running it as a service
TriBridge is a foreground process with no built-in supervision. Use whatever your host provides —systemd,
pm2, a Docker restart policy — and point it at:
node directly rather than at npm start. npm would sit between the supervisor and
the bot as an extra process, and stop and restart signals have to pass through it to reach the process that
actually holds the Discord and Hypixel connections.
The bot reconnects to Hypixel on its own (Reconnection); it does not restart itself if the
Node process dies, which is what the supervisor is for.