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.

The Discord Faceit Hub Bot ships with a full-featured React admin dashboard served directly from the bot’s Express server. Every aspect of the bot — users, live matches, configuration, feature flags, and logs — is manageable from a single authenticated web interface without needing CLI access or direct Firestore edits.

Access and Authentication

Navigate to https://your-domain/admin to open the panel. Unauthenticated requests redirect automatically to Discord OAuth2 at /auth/discord. After Discord OAuth2 completes, the server verifies your role in Firestore. Only users with the admin or global_admin role are allowed to proceed. A signed JWT is issued and stored in two cookies — auth_token and admin_token — both configured httpOnly, scoped to secure when BASE_URL starts with https, and valid for 8 hours.
To grant a user admin access, open Firestore, find the document for that user’s Discord ID in the faceit_users collection, and set the rol field to "admin" along with the servidor field containing their Discord guild ID. global_admin users can manage all guilds and are identified by a hardcoded Discord user ID in the auth route.
Multi-guild support: global_admin users see a guild selector dropdown in the sidebar and can switch between all configured guilds. admin users are scoped to a single guild and see only their guild’s data.

Dashboard Tab

The landing tab gives an at-a-glance operational view of the bot:

Total Linked Users

Count of all Discord/Faceit accounts linked in this guild.

Active Matches

Number of matches currently tracked in faceit_active_matches.

Bot Uptime

Process uptime in hours and minutes, pulled from /api/admin/system.

Hub Region

Hub region string fetched from Faceit API and stored in system info.
Below the KPI cards sits a feature flag quick-toggle grid so you can enable or disable any capability without leaving the dashboard.

Tabs Reference

A searchable, paginated table (15 rows per page) of all linked Discord/Faceit accounts for the selected guild. Each row shows Discord ID, Faceit nickname, Faceit Player ID, status (Verificado / Pendiente / Baneado), and linked-at timestamp.Filters: filter by status using the dropdown (All, Verificado, Pendiente, Baneado).Actions per row:
  • Unlink (POST /api/admin/users/:discordId/unlink) — removes the account link and reverts Discord roles.
  • Manual Verify — opens a modal to link a Discord ID to a Faceit nickname manually via POST /api/admin/users/verify.
  • Assign Role — opens a modal to assign a level role (1–10) or a special club role via POST /api/admin/users/:discordId/roles.
  • Admin Permissions — opens a modal to set the user’s web panel role (usuario, admin, or global_admin) via POST /api/admin/users/:discordId/admin-role.
Bulk actions:
  • Export Backup (GET /api/admin/users/backup) — downloads a dated JSON file of all user records.
  • Import Backup (POST /api/admin/users/restore) — restores or merges users from a previously exported JSON file.
  • Sync All (POST /api/admin/users/sync-all) — triggers a full re-sync of all users against the Faceit API, updating ELO and roles.
A live table of all active matches tracked in Firestore (faceit_active_matches). Each row shows match ID, Team A vs Team B, map, server location, and elapsed time since start.Matches running longer than 60 minutes are highlighted as potentially stuck. Click Force Cleanup per row to call POST /api/admin/matches/:matchId/cleanup, which deletes voice channels and removes the match from Firestore.
A full historical record of completed matches loaded from GET /api/admin/matches/history. The table displays date/time, match ID (linked to the Faceit room page for non-Mixton matches), the two faction names with final scores, map, and server location. Roster nicknames for each faction are shown inline below the score.
Displays the hub season leaderboard fetched from the Faceit API via /api/admin/leaderboard. Columns: rank position, Faceit nickname, skill level, and hub points. Data is guild-scoped using faceitLeaderboardId from the bot config.
Search any Faceit player by nickname. The panel calls GET /api/admin/stats/:nickname and renders their profile card showing:
  • Faceit level and ELO
  • K/D ratio and win rate
  • Total matches played
  • Last 10 match results (W/L form strip)
Lists all open support call requests raised by players (via the in-Discord support panel). Each entry shows the requesting player, timestamp, and status. Admins can mark calls as resolved, which removes them from the queue and notifies the player.
Edit the two message templates used by the bot:Welcome DM — the embed sent to new members who link their Faceit account. Editable fields: title, description body, and HEX color.Support Panel Message — the embed posted in the support channel for admin call alerts. Same editable fields.Changes are saved via POST /api/admin/messages and take effect on the next triggered event.
Edit all bot settings for the selected guild. Changes are persisted to Firestore via POST /api/admin/guilds/:guildId/settings and override environment variable defaults.
FieldDescription
discordGuildIdDiscord server (guild) ID
discordLinkChannelIdChannel where /verificar_fc link messages are posted
discordMatchesChannelIdChannel for match announcement embeds
discordRolesChannelIdChannel for role assignment notifications
discordStatusChannelIdChannel for LATAM server status embeds
discordWaitingRoomChannelIdVoice channel ID used as parent for match voice channels
discordAdminAlertsChannelIdChannel for admin/support alert pings
discordSupportChannelIdChannel hosting the support panel
faceitHubIdUUID of the Faceit Hub to monitor
faceitLeaderboardIdLeaderboard ID for /leaderboard command
adminRoleNameDiscord role name treated as admin (default: ADMIN)
matchTimeoutMinutesMinutes after which a stuck match is auto-cleaned (default: 120)
Full list of every feature flag with a toggle switch. Each toggle calls POST /api/admin/features/:key?guildId=... with { "enabled": true/false }. Changes are guild-scoped and take effect within 30 seconds (the in-memory cache TTL). See the Feature Flags reference for the complete flag list.
Broadcast a direct message (DM) to linked users. You can send to a specific user (search by Faceit nickname to select a target) or to all verified users at once via POST /api/admin/broadcast. Mass broadcasts run in the background and a toast notification confirms the send was initiated.
Send a simulated Faceit webhook event to the bot’s own /webhook/faceit endpoint without needing a real Faceit Hub match. Select an event type and configure match details:
  • Event types: match_status_configuring, match_status_starting, match_status_finished, match_status_cancelled
  • Fields: Match ID, map (de_mirage, etc.), Team A name, Team B name
  • For finished events: winner faction and score (A–B)
The simulator populates rosters from the first 10 currently linked users, filling any gaps with placeholder player IDs. The payload is sent via POST /api/admin/simulate-webhook and the bot processes it exactly as a real webhook.
Real-time console log viewer. Logs are fetched from /api/admin/logs every 4 seconds when this tab is active (other tabs use the standard 30-second poll interval). Filter by level using the dropdown:
LevelColorMeaning
infoBlueRoutine operations
warnYellowNon-critical warnings
errorRedErrors requiring attention
successGreenCompleted actions
Each entry shows a timestamp, level badge, and message. The log list is sourced from Firestore log entries written by the bot’s logger utility.

Build docs developers (and LLMs) love