The bot’s webhook endpoint receives real-time events from your Faceit Hub — match status transitions, results, and club role changes — and translates them into Discord actions: announcements, voice channels, role updates, and match cleanup. Everything the bot does in response to matches flows through this single endpoint.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.
Endpoint
- Rate limit: 60 requests per minute (stricter than the global 100 req/min limit applied to all other routes).
- Response:
200 OKis sent immediately before the event is processed. Event processing is async — Faceit does not need to wait for Discord API calls to complete.
Setup Steps
Open Faceit Hub Webhook Settings
Log in to your Faceit account, navigate to your Hub dashboard, and go to Settings → Webhooks → Add new webhook.
Enter the Webhook URL
Set the URL to:Your domain must be publicly reachable over HTTPS — Faceit will not deliver to
http:// endpoints or private IPs.Subscribe to Events
Enable these event subscriptions:
match_status_configuringmatch_status_startingmatch_status_readymatch_status_finishedmatch_status_cancelledmatch_status_abortedhub_user_role_addedhub_user_role_removed
Signature Validation
WhenwebhookValidation is enabled and FACEIT_WEBHOOK_SECRET is set, the bot performs header validation before processing any event:
401 Unauthorized. See Feature Flags for how to toggle webhookValidation.
Event Routing
The bot extracts the Hub ID fromevent.entity.id (falling back to event.payload.hub_id) and looks up which Discord guilds are configured for that hub:
getEffectiveConfigForGuild(guildId).
Handled Events
match_status_configuring — Lobby Created
match_status_configuring — Lobby Created
Triggered when a match is created and players are being assembled.Bot actions:
- Creates a match embed with status
configuringusingcreateMatchEmbed(matchData, 'configuring'). - Posts the embed to the
discordMatchesChannelIdchannel. - Stores the match in Firestore
faceit_active_matcheswith message ID, faction rosters, and hub/guild association viadb.addActiveMatch(...). - Updates the live match panel embed via
updateLivePanel(...).
matchAnnouncementsmatch_status_starting / match_status_ready — Match Started
match_status_starting / match_status_ready — Match Started
Triggered when the match server is ready and the match has begun.Bot actions:
- Creates voice channels for both factions (if
autoVoiceChannelsis enabled) viacreateMatchVoiceChannels(guild, waitingRoomId, faction1, faction2, db). - Moves players to their respective voice channels (if
autoMovePlayersis enabled) viamovePlayersToVoice(...). - Builds team lists with Discord mentions for all players that have linked accounts.
- Edits the configuring embed to the
startedstate, or sends a new one if the original message is not found. - Posts a server status embed to
discordStatusChannelId(ifserverStatusAnnouncementsis enabled), showing LATAM server health for the match location. - Updates the live match panel.
matchAnnouncements, autoVoiceChannels, autoMovePlayers, serverStatusAnnouncementsmatch_status_finished — Match Finished
match_status_finished — Match Finished
Triggered when the match ends with a result.Bot actions:
- Deletes both team voice channels and moves players back to the waiting room via
cleanupVoiceChannel(...). - Builds final team lists with Discord mentions (using stored rosters from Firestore if the webhook payload has empty rosters).
- Edits the match embed to
finishedstate with winner and score. - Removes the match from
faceit_active_matchesviadb.removeActiveMatch(matchData.id). - Saves the result to
faceit_matches_historyviadb.addMatchToHistory(...)with winner, score, and rosters. - Syncs Faceit levels for all players in both factions if
autoRoleSyncis enabled — calls the Faceit API per player and updates Discord roles. - Updates the live match panel.
matchAnnouncements, autoRoleSyncmatch_status_cancelled / match_status_aborted — Match Cancelled
match_status_cancelled / match_status_aborted — Match Cancelled
Triggered when a match is cancelled before completion.Bot actions:
- Deletes both team voice channels and moves players back to the waiting room.
- Edits (or sends) the match embed with
cancelledstatus. - Removes the match from
faceit_active_matches. - Logs a warning-level entry via
db.addLogEntry('warn', ...). - Updates the live match panel.
matchAnnouncementshub_user_role_added — Club Role Granted
hub_user_role_added — Club Role Granted
Triggered when a Faceit Hub admin grants a special club role to a player.Bot actions:
- Maps the Faceit
role_idto a Discord role name usingCLUB_ROLES_MAP(supportsEXTREME,PREMIUM,PLUS,EXTREME BAJOS). - Looks up the player’s Discord ID from their Faceit Player ID in Firestore.
- Gets or creates the matching Discord role in the guild via
getOrCreateSpecialRole(guild, roleName). - Adds the role to the Discord member and posts a notification to
discordRolesChannelId.
autoRoleSynchub_user_role_removed — Club Role Revoked
hub_user_role_removed — Club Role Revoked
Triggered when a special club role is removed from a player.Bot actions:
- Same lookup as
hub_user_role_added. - Removes the corresponding Discord role from the member.
- Posts a notification to
discordRolesChannelId.
autoRoleSyncExample Webhook Payload
entity.id field is the Hub UUID — this is what db.getGuildIdsByHubId() uses to route the event to the correct Discord guild. Ensure the Hub ID in this field matches the faceitHubId value in your bot config.
Testing Webhooks
Use the Simulator tab in the Admin Panel to send mock webhook payloads to the bot without a real Faceit Hub match. The simulator constructs a valid payload using your current linked users as roster members and callsPOST /api/admin/simulate-webhook which forwards it to the internal webhook handler.
Health Check
| Field | Description |
|---|---|
status | Always "ok" if the Express server is running |
discord | "connected" if the Discord client has logged in, "disconnected" otherwise |
uptime | Process uptime in seconds (process.uptime()) |
timestamp | Current ISO timestamp |