For the complete documentation index, see llms.txt. This page is also available as Markdown.

Setup

A step-by-step guide to self-host the Tworst Admin Bot and connect it to your server.

Set up the Web Panel (Tworst Cloud) first — you'll need your cloud credentials (tenantId, serverId, bot secret) to connect the bot.


Step 1: Create a Discord Application & Bot

  1. Click New Application, give it a name (e.g. "TW Admin Bot")

  2. Open the Bot tab → Reset/Copy Token → this is your DISCORD_BOT_TOKEN

  3. Copy the Application ID from the General Information tab → this is your DISCORD_BOT_CLIENT_ID


Step 2: Invite the Bot to Your Server

  1. In the application, open OAuth2 → URL Generator

  2. Select scopes: bot and applications.commands

  3. Select bot permissions: Manage Roles, Manage Channels, Send Messages, Embed Links, Read Message History, Mention @everyone, @here, and All Roles

  4. Open the generated URL, pick your Discord server, and authorize

Manage Roles / Manage Channels are only needed if you plan to use role sync and the event/ticket logging features. You can grant a narrower set if you don't.


Step 3: Get Your Tworst Cloud Credentials

From panel.tworst.com, open your server's settings and note:

  • Tenant ID (BOT_TENANT_ID)

  • Server ID / slug (BOT_SERVER_ID)

  • Bot Secret (BOT_SECRET)


Step 4: Download & Install


Step 5: Configure .env

Copy the example and fill in your values:

At minimum, set:

See Configuration for every available option (role sync, event/ticket channels, language, etc.).


Step 6: Register Slash Commands

This registers all / commands with Discord. Guild-scoped commands appear instantly.


Step 7: Start the Bot

You should see output similar to:

Test it by running /status in your Discord server — you should see your server's live status.


Step 8 (Optional): Channels & Role Sync

  • Event announcements: create a channel, then run /event-channel set #events

  • Role sync: set BOT_ROLE_SYNC=1 and BOT_GUILD_ID in .env, restart, then run /sync

Ticket logs are configured in-game, not via the bot — set the ticket webhooks in shared/webhooks.lua. See Admin Menu → Configuration.


Hosting Tips

The bot must stay running 24/7. For production, run it on a VPS with a process manager (e.g. pm2) so it restarts automatically. Running it on your PC only works while that PC is on.


Troubleshooting

Bot won't start

  • Confirm .env is in the project root with all required fields filled in

  • Check Node.js version: node --version (must be 20+)

  • Make sure npm install finished without errors

Bot online but commands fail / "not connected"

  • Double-check BOT_SECRET, BOT_TENANT_ID, BOT_SERVER_ID

  • Confirm your server is paired and connected in the web panel

  • Set BOT_DEBUG_BRIDGE=1 for verbose connection logs

Slash commands don't appear

  • Run npm run deploy-commands again

  • Global commands can take up to an hour to propagate; guild-scoped are instant

Role sync not working

  • Ensure BOT_ROLE_SYNC=1 and BOT_GUILD_ID are set, then restart

  • Make sure the bot has Manage Roles permission and its role is high enough in the Discord role list

  • Run /sync to trigger a manual sync


Need Help?

Join our Discord server and open a support ticket with your console output (enable BOT_DEBUG_BRIDGE=1 first).

Last updated