Skip to main content

Documentation 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.

All configuration for the bot is driven by environment variables loaded from a .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.
Channel IDs, hub IDs, and feature flags can also be managed from the admin panel without restarting the bot. Values saved through the panel are written back to .env and to process.env immediately. See the Configuration guide for per-guild Firestore settings that override the values below on a server-by-server basis.

Required

These variables must be set before the bot will start. The validateConfig() call in config/index.js throws an error at startup if either of the first two is missing.
DISCORD_TOKEN
string
required
The bot token from the Discord Developer Portal. Used to log the bot into the Discord gateway. Never share this value.
DISCORD_CLIENT_ID
string
required
The application ID (also called Client ID) found on the Discord Developer Portal. Used when registering slash commands and constructing the OAuth2 authorization URL.
DISCORD_CLIENT_SECRET
string
required
The OAuth2 client secret for the Discord application. Used to exchange authorization codes for access tokens during the admin panel login flow.
ADMIN_JWT_SECRET
string
required
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

FIREBASE_SERVICE_ACCOUNT_PATH
string
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

FACEIT_API_KEY
string
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.
FACEIT_HUB_ID
string
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.
FACEIT_LEADERBOARD_ID
string
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.
FACEIT_WEBHOOK_SECRET
string
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

DISCORD_GUILD_ID
string
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.
DISCORD_MATCHES_CHANNEL_ID
string
Channel ID for match announcement embeds and the live match panel. Faceit webhook events post match started/finished messages here.
DISCORD_ROLES_CHANNEL_ID
string
Channel ID where role change notifications are posted when a player’s Faceit level changes.
DISCORD_STATUS_CHANNEL_ID
string
Channel ID where the server status embed is auto-deployed and kept updated.
DISCORD_ADMIN_ALERTS_CHANNEL_ID
string
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.
DISCORD_WAITING_ROOM_CHANNEL_ID
string
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.
DISCORD_SUPPORT_CHANNEL_ID
string
Channel ID where the support panel embed (with the “Call Admin” button) is auto-deployed on bot startup and kept pinned.

Server

PORT
number
Port number for the Express HTTP server. Defaults to 3000.
BASE_URL
string
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 secure flag (set automatically when BASE_URL starts with https or NODE_ENV=production)
Defaults to http://localhost:{PORT}.
ADMIN_ROLE_NAME
string
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.
MATCH_TIMEOUT_MINUTES
number
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.
NODE_ENV
string
Standard Node.js environment identifier. Set to "production" to:
  • Enable the secure flag on JWT session cookies (requires HTTPS)
  • Apply any other production-mode guards
Defaults to "development".

Quick Reference Table

VariableRequiredDefault
DISCORD_TOKEN
DISCORD_CLIENT_ID
DISCORD_CLIENT_SECRET
ADMIN_JWT_SECRET
FIREBASE_SERVICE_ACCOUNT_PATHApplication 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
PORT3000
BASE_URLhttp://localhost:3000
ADMIN_ROLE_NAME"ADMIN"
MATCH_TIMEOUT_MINUTES120
NODE_ENV"development"
* Functionally required for core features (Faceit integration and Discord guild operations) even though the bot will start without them.

Build docs developers (and LLMs) love