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

Configuration

The bot is configured through a .env file in the project root. Some settings can also be changed at runtime with slash commands (they persist to the data/ folder).


Environment Variables

Required

Variable
Description

DISCORD_BOT_TOKEN

Your Discord bot token (Developer Portal → Bot)

DISCORD_BOT_CLIENT_ID

Your Discord application ID (for registering slash commands)

BOT_AGENT_URL

Tworst Cloud bot endpoint — wss://panel.tworst.com/bot

BOT_SECRET

Bot secret from your Tworst Cloud server settings

BOT_TENANT_ID

Your tenant ID from the dashboard

BOT_SERVER_ID

Your server slug (set when you created the server)

Role / Staff Sync (Optional)

Variable
Default
Description

BOT_ROLE_SYNC

0

1 enables bidirectional role mirroring + /sync, /teamsync, /setrole, /unstaff

BOT_GUILD_ID

Discord server ID where roles are synced (required when sync is on)

BOT_ROLE_PREFIX

TW |

Prefix for synced roles (e.g. "TW | Admin")

Events (Optional)

Variable
Default
Description

BOT_EVENT_CHANNEL_ID

Channel for event announcements (or set via /event-channel)

BOT_EVENT_MENTION_ROLE_ID

Role to mention on event posts

BOT_EVENT_DM_STAFF

1

0 = DM each staff member on events, 1 = channel-only

Ticket logging is no longer handled by the bot. As of Admin Menu v1.0.3, ticket open/close logs are posted directly from the game via shared/webhooks.lua (tickets / ticketsOpen / ticketsClose) — no bot required. See Configuration → webhooks.

Other (Optional)

Variable
Default
Description

BOT_LOCALE

en

Bot language: en, tr, de, fr, es (or change via /language)

BOT_DEBUG_BRIDGE

0

1 = verbose WebSocket logging (troubleshooting only)


Role Sync Explained

By default (BOT_ROLE_SYNC=0) the bot only provides moderation/info commands. Setting BOT_ROLE_SYNC=1 unlocks:

  • Bidirectional mirroring — assign an in-game staff role and the matching Discord role is applied automatically, and vice-versa

  • /sync — perform a full role sync and view current mappings

  • /teamsync — sync Discord team members with in-game teams

  • /setrole / /unstaff — manage in-game staff directly from Discord

Synced Discord roles are named using BOT_ROLE_PREFIX (e.g. TW | Admin). Leave sync off if you don't want Discord to control in-game staff.


Runtime Configuration

These settings are stored in the data/ folder and can be changed without editing .env:

File
Set via
Stores

data/bot-config.json

/language set

Bot language

data/event-config.json

/event-channel

Event channel + mention role

data/role-mapping.json

auto (role sync)

Game role → Discord role mapping

These files are created automatically on first use. Delete them to reset to your .env defaults.


Permissions Model

The only exceptions are the configuration commands (/language, /event-channel), which require the Discord Manage Server permission.


.env.example Reference

Last updated