All configuration for the bot is driven by environment variables loaded from aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/VasquezRivero92/Discord_Faceit/llms.txt
Use this file to discover all available pages before exploring further.
.env file at startup via dotenv. They are imported into the env object in config/index.js and are the baseline values; per-guild overrides stored in Firestore take precedence at runtime for most channel and hub settings. The variables below are grouped by concern.
Required
These variables must be set before the bot will start. ThevalidateConfig() call in config/index.js throws an error at startup if either of the first two is missing.
The bot token from the Discord Developer Portal. Used to log the bot into the Discord gateway. Never share this value.
The application ID (also called Client ID) found on the Discord Developer Portal. Used when registering slash commands and constructing the OAuth2 authorization URL.
The OAuth2 client secret for the Discord application. Used to exchange authorization codes for access tokens during the admin panel login flow.
A long, random string used to sign and verify JWT session tokens. Generate with
openssl rand -hex 32. Changing this value immediately invalidates all existing sessions.Firebase
Filesystem path to the Firebase service account JSON key file (e.g.
./firebase-service-account.json). If this variable is set and the file exists, the bot initializes Firebase using the explicit credentials. If the variable is unset or the file is not found, Firebase falls back to Application Default Credentials (suitable for Cloud Run, GKE, and other Google-managed environments).Faceit
Server-side Data API v4 key from the Faceit Developer Portal. Required for all Faceit API calls — player lookups, match data, leaderboard, and hub info. Without this key, most bot features are non-functional.
UUID of the Faceit Hub the bot monitors (e.g.
"f4d4b0e0-1234-5678-abcd-ef0123456789"). Used for match webhooks and the /admin/system hub region lookup. Can be overridden per-guild in Firestore.UUID of the current season leaderboard. Required for the
/api/admin/leaderboard endpoint. Optional — the leaderboard endpoint returns an empty array when this is not set. Can be overridden per-guild in Firestore.Webhook signature secret provided by Faceit. Used to verify the
X-Signature header on incoming webhook requests when the webhookValidation feature flag is enabled. Optional — signature validation is skipped when this is not set or the flag is off.Discord Guild & Channels
The primary Discord server (guild) ID. Used as the default target for slash command registration, role syncing, and match operations when no
guildId is specified. Can be overridden per-guild in the Firestore settings.Channel ID (or comma-separated list of IDs) where the
/verificar_fc verification command is permitted. The bot ignores the command in all other channels.Channel ID for match announcement embeds and the live match panel. Faceit webhook events post match started/finished messages here.
Channel ID where role change notifications are posted when a player’s Faceit level changes.
Channel ID where the server status embed is auto-deployed and kept updated.
Channel ID for staff support alert notifications. When a player opens a support call via the support panel, an embed is sent here with action buttons for admins.
Voice channel ID used as a staging area. Players are moved here when a match ends and their original channel is deleted. Also used to determine the category when creating new match voice channels.
Channel ID where the support panel embed (with the “Call Admin” button) is auto-deployed on bot startup and kept pinned.
Server
Port number for the Express HTTP server. Defaults to
3000.The public-facing URL of the bot’s web server (e.g.
https://bot.example.com). Used in two critical places:- As the OAuth2 redirect URI:
{BASE_URL}/auth/discord/callback - To determine whether cookies should be set with the
secureflag (set automatically whenBASE_URLstarts withhttpsorNODE_ENV=production)
http://localhost:{PORT}.The Discord role name that the bot recognizes as having admin access for the purposes of
checkIsAdmin. Defaults to "ADMIN". Can be overridden per-guild in Firestore.Number of minutes before an active match is automatically force-expired and cleaned up by the match timeout scheduler. Defaults to
120 (2 hours). Can be overridden per-guild in Firestore.Standard Node.js environment identifier. Set to
"production" to:- Enable the
secureflag on JWT session cookies (requires HTTPS) - Apply any other production-mode guards
"development".Quick Reference Table
| Variable | Required | Default |
|---|---|---|
DISCORD_TOKEN | ✅ | — |
DISCORD_CLIENT_ID | ✅ | — |
DISCORD_CLIENT_SECRET | ✅ | — |
ADMIN_JWT_SECRET | ✅ | — |
FIREBASE_SERVICE_ACCOUNT_PATH | ❌ | Application Default Credentials |
FACEIT_API_KEY | ❌* | — |
FACEIT_HUB_ID | ❌* | — |
FACEIT_LEADERBOARD_ID | ❌ | — |
FACEIT_WEBHOOK_SECRET | ❌ | — |
DISCORD_GUILD_ID | ❌* | — |
DISCORD_LINK_CHANNEL_ID | ❌ | — |
DISCORD_MATCHES_CHANNEL_ID | ❌ | — |
DISCORD_ROLES_CHANNEL_ID | ❌ | — |
DISCORD_STATUS_CHANNEL_ID | ❌ | — |
DISCORD_ADMIN_ALERTS_CHANNEL_ID | ❌ | — |
DISCORD_WAITING_ROOM_CHANNEL_ID | ❌ | — |
DISCORD_SUPPORT_CHANNEL_ID | ❌ | — |
PORT | ❌ | 3000 |
BASE_URL | ❌ | http://localhost:3000 |
ADMIN_ROLE_NAME | ❌ | "ADMIN" |
MATCH_TIMEOUT_MINUTES | ❌ | 120 |
NODE_ENV | ❌ | "development" |