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 bot uses Google Cloud Firestore (via the Firebase Admin SDK) as its persistence layer. Data is organized across several top-level collections. All collection names are defined as constants in database.js and are reproduced here for reference. Document IDs are noted for each collection — most are either the Discord user ID or a Faceit match ID.
Several hot-path reads are served from in-memory caches to reduce Firestore read quotas. Settings (global and per-guild) are cached for 30 seconds. Ready players are cached for 30 seconds. Active matches are cached for 10 seconds. User profiles (by Discord ID, Faceit ID, and Faceit nickname) are cached for 5 minutes. The cache is invalidated on any write that touches the corresponding document.

faceit_users

Stores every verified Discord ↔ Faceit account link. This is the largest and most frequently read collection. Document ID: Discord user ID, or {guildId}_{discordId} for multi-guild installs.
FieldTypeDescription
discordIdstringThe Discord user ID (snowflake). Redundantly stored inside the document for queries that scan the collection.
guild_idstring | nullDiscord guild ID this link belongs to.
faceit_player_idstringFaceit UUID of the linked player.
faceit_nicknamestringFaceit username at the time of linking.
faceit_nickname_lowerstringLowercase version of faceit_nickname for case-insensitive queries.
faceit_levelnumberFaceit skill level (1–10). Updated on role sync.
faceit_elonumberFaceit ELO rating. Updated on role sync.
linkedAtTimestampServer timestamp set when the account is first linked.
updatedAtTimestampServer timestamp set on every update.
rolstringWeb panel role: "usuario", "admin", or "global_admin".
servidorstring | nullGuild ID the admin role is scoped to.
discord_usernamestringCached Discord username (updated lazily).
discord_displayNamestringCached Discord display name.
discord_avatarstringCached Discord avatar URL.
mixton_readybooleantrue when the player has run /mixton_listo and is in the draft queue.
mixton_ready_atnumberUnix timestamp (ms) when the player joined the queue.
mixton_guild_idstringGuild ID of the Mixton lobby the player queued for.
mixton_tier_overridestring | nullAdmin-assigned ELO tier override: "S", "A", "B", "C", or null.

faceit_pending_verifications

Temporary documents created when a user starts the /verificar_fc flow but has not yet confirmed their code. Documents are automatically expired after 15 minutes and deleted when verification completes. Document ID: Discord user ID.
FieldTypeDescription
faceitNicknamestringThe Faceit username the user is attempting to link.
codestringThe verification code sent to the user.
expiresAtnumberUnix timestamp (ms) after which the pending verification is invalid.

faceit_active_matches

One document per in-progress Faceit match (or manually created match). Documents are removed when the match finishes, is cancelled, or is force-cleaned via the admin panel. Document ID: Faceit match ID, or manual_{timestamp}_{random} for web-created matches.
FieldTypeDescription
idstringThe match ID (mirrors the document ID).
entity_custom_namestringHub or custom name for the match (e.g. "Club").
gamestringGame identifier (e.g. "cs2").
mapstringMap name or "Votando..." if voting is pending.
locationstringServer location or "Votando..." if voting is pending.
faction1_namestringDisplay name for Team 1 (e.g. "Equipo A").
faction2_namestringDisplay name for Team 2 (e.g. "Equipo B").
faction1_rosterarrayArray of { id, nickname, discord_id } for Team 1 players.
faction2_rosterarrayArray of { id, nickname, discord_id } for Team 2 players.
faction1_vc_idstring | nullDiscord voice channel ID created for Team 1.
faction2_vc_idstring | nullDiscord voice channel ID created for Team 2.
message_idstring | nullDiscord message ID of the match announcement embed.
original_voice_statesobjectMap of { discordId: voiceChannelId } recording where each player was before being moved. Used to restore positions on cleanup.
creator_idstring | nullDiscord user ID of the admin who launched a manual match. null for Faceit webhook matches.
guild_idstringDiscord guild ID this match belongs to.
startedAtnumberUnix timestamp (ms) when the match document was created. Used for timeout calculations.
createdAtTimestampServer timestamp.

faceit_matches_history

Completed matches archived for the history view. Documents are written by the webhook handler when a match finishes. Document ID: Faceit match ID.
FieldTypeDescription
idstringMatch ID.
entity_custom_namestringHub or custom name.
gamestringGame identifier.
mapstringFinal map played.
locationstringServer location.
faction1_namestringTeam 1 display name.
faction2_namestringTeam 2 display name.
faction1_scorenumberTeam 1 final score.
faction2_scorenumberTeam 2 final score.
winnerstring"faction1" or "faction2".
faction1_rosterarrayArray of { id, nickname, discord_id }.
faction2_rosterarrayArray of { id, nickname, discord_id }.
guild_idstringDiscord guild ID.
createdAtTimestampServer timestamp when the match result was recorded.

faceit_config

A multipurpose configuration collection. Each document serves a distinct role, identified by its document ID.

settings

Global bot settings and feature flags. Cached for 30 seconds. These values are merged with .env at runtime — Firestore values take precedence.
FieldTypeDefaultDescription
discordGuildIdstringenvPrimary guild ID.
discordLinkChannelIdstringenvChannel for /verificar_fc.
discordMatchesChannelIdstringenvMatch announcements channel.
discordRolesChannelIdstringenvRole change notifications channel.
discordStatusChannelIdstringenvServer status channel.
discordWaitingRoomChannelIdstringenvWaiting room voice channel.
discordAdminAlertsChannelIdstringenvStaff alerts channel.
discordSupportChannelIdstringenvSupport panel channel.
faceitHubIdstringenvFaceit Hub UUID.
faceitLeaderboardIdstringenvFaceit Leaderboard UUID.
adminRoleNamestring"ADMIN"Discord role granting admin access.
matchTimeoutMinutesnumber120Auto-expiry timeout for active matches.
autoWelcomeDmbooleantrueSend welcome DM to new server members.
autoRoleSyncbooleantrueAutomatically sync Faceit level roles.
autoVoiceChannelsbooleantrueCreate voice channels when a match starts.
autoMovePlayersbooleantrueAuto-move players to match voice channels.
matchAnnouncementsbooleantruePost match started/finished embeds.
serverStatusAnnouncementsbooleantrueKeep the server status embed updated.
liveMatchPanelbooleantrueMaintain the live match panel embed.
webhookValidationbooleanfalseValidate X-Signature on Faceit webhooks.
adminCallNotificationsbooleantrueSend staff alerts for support calls.
updatedAtTimestampLast update timestamp.

guild_settings

Per-guild settings overrides stored in a separate top-level collection (not inside faceit_config). Document ID is the guild ID. Fields mirror the settings document in faceit_config — only fields present in this document override the corresponding global default at runtime. Used by getEffectiveConfigForGuild(guildId) in config/index.js to merge guild-specific values on top of the global configuration.

panel (inside faceit_config)

Persists the Discord message ID and channel ID of the live match panel embed so it can be updated in-place across restarts.
FieldTypeDescription
messageIdstringDiscord message ID of the live panel.
channelIdstringDiscord channel ID where the panel lives.
updatedAtTimestampLast update timestamp.

status_panel (inside faceit_config)

Same shape as panel but for the server status embed.
FieldTypeDescription
messageIdstringDiscord message ID of the status embed.
channelIdstringDiscord channel ID where the status embed lives.
updatedAtTimestampLast update timestamp.

messages (inside faceit_config)

Customizable message templates for the welcome DM and support panel embed.
FieldTypeDescription
welcomeTitlestringTitle for the welcome DM embed.
welcomeDescriptionstringBody text — supports {username}, {clubUrl}, {linkChannelMention} placeholders.
welcomeColorstringHex color for the welcome embed (e.g. "#FF5500").
supportTitlestringTitle for the support panel embed.
supportDescriptionstringBody text for the support panel.
supportColorstringHex color for the support embed.
updatedAtTimestampLast update timestamp.

mixton_lobby_{guildId} (inside faceit_config)

Persistent state for the Mixton Arena lobby. One document per guild, keyed as mixton_lobby_{guildId}. A default document (key mixton_lobby) is used for single-guild deployments.
FieldTypeDescription
teamsarrayArray of team objects: { id, name, captain, players[] }. Captain and each player are full player profile objects including discordId, faceit_nickname, faceit_level, faceit_elo, and discordUser.
pickOrderarrayOrdered array of team IDs defining the draft pick sequence.
currentPickIndexnumberIndex into pickOrder pointing to the team whose captain is currently picking.
draftStartedbooleantrue after POST /mixton-start is called.
draftFinishedbooleantrue after the match is created via POST /mixton-create-match.
updatedAtnumberUnix timestamp (ms) of the last state write.

faceit_support_calls

Support call records created when a player presses the “Call Admin” button in the support panel channel. Document ID: Auto-generated support call ID.
FieldTypeDescription
idstringSupport call ID.
match_idstringActive Faceit match ID at the time of the call.
match_urlstringDirect URL to the Faceit match room.
faceit_player_idstringFaceit UUID of the requesting player.
faceit_nicknamestringFaceit username.
discord_idstringDiscord user ID of the requesting player.
descriptionstringUser-provided issue description.
statusstring"pendiente" (open) or "atendida" (resolved).
claimedBystring | nullDiscord tag or "WebAdmin (username)" of the admin who resolved it.
claimedAtnumber | nullUnix timestamp (ms) when the call was resolved.
guild_idstringDiscord guild ID.
createdAtTimestampServer timestamp.

faceit_bot_logs

Bot activity log entries. Only error, warn, and system-sourced entries are written to keep Firestore write usage low. Entries older than 7 days are pruned automatically by db.pruneOldLogs(). Document ID: Auto-generated by Firestore.
FieldTypeDescription
levelstringLog level: "error", "warn", "info", or "success".
messagestringHuman-readable log message.
sourcestringOrigin of the log: "bot", "system", or a command/event name.
guild_idstring | nullGuild ID if the event is guild-specific.
createdAtTimestampServer timestamp.

Build docs developers (and LLMs) love