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.

Mixton Arena is the browser-based captain draft interface for organizing custom matches within your Faceit Hub. Admins configure teams, captains pick players from an ELO-tiered pool in a defined order, and the panel pushes every state change live to all open browsers via WebSocket — no page refreshes required.

Access

Navigate to https://your-domain/ (the root path). Login requires Discord OAuth2. The server grants access to users with the admin or global_admin role and to any Discord user who is currently assigned as a captain in any active lobby. Users who are neither admins nor captains receive an access-denied page at the auth step. After authentication, the panel calls /api/lobby/me to verify the session and loads the current lobby state for the guild. Admin users see a guild selector dropdown to switch between multiple configured servers.

Player Pool

The available player pool is displayed as four ELO-tier columns: S, A, B, and C. Each Player object in the pool carries:
interface Player {
  discordId: string;
  faceit_nickname: string;
  faceit_level: number;
  faceit_elo: number;
  mixton_guild_id: string;
  mixton_tier_override?: string | null;
}
Players appear in the pool after they run /mixton_listo in Discord. Their tier is automatically calculated from their faceit_elo. If a player’s ELO data is unavailable or their skill level doesn’t match their displayed tier, an admin can override it (see Admin Controls below). You can filter the visible pool by tier tab (ALL / S / A / B / C) or by typing in the search box to find a player by Faceit nickname.

Team Grid

The team grid shows all configured teams side-by-side. Each team card displays:
  • Team name and ID
  • Assigned captain (Faceit nickname + Discord avatar)
  • All picked players with their tier badge and ELO
  • Average team ELO (calculated across captain + all 5 picks)
Teams without an assigned captain are shown with an empty captain slot. The grid is fully interactive during the pick phase — the currently active team’s card is highlighted when it is their turn to pick.

Draft Flow

1

Configure Teams

Use the setup panel to choose the number of teams (2–6). Click Setup to call POST /api/lobby/mixton-setup which initializes the lobby state in Firestore with the selected team count and empty rosters.
2

Assign Captains

For each team, click the captain slot and select a player from the pool. This calls POST /api/lobby/mixton-assign-captain. A player assigned as captain is removed from the general pick pool for that team.
3

Set Pick Order

Drag team rows to reorder them, or click Randomize to shuffle the pick order. When satisfied, click Save Order to persist via POST /api/lobby/mixton-pick-order. The pickOrder array stored in the lobby state is a sequence of team IDs.
4

Start Draft

Click Start Draft. This calls POST /api/lobby/mixton-start which sets draftStarted: true in the lobby state. A status banner shows which team’s captain is currently picking.
5

Captains Pick Players

Each captain sees the player pool and clicks a player card to select them. A pending-pick confirmation overlay appears before confirming the selection. Picks are submitted via POST /api/lobby/mixton-pick. The panel advances currentPickIndex and broadcasts the updated state to all connected panels instantly via WebSocket.Admins can pick on behalf of any captain at any time during the draft.
6

Finish Draft and Launch Match

When all picks are exhausted (currentPickIndex >= pickOrder.length), the lobby enters draftFinished: true state and a “Draft Finalizado” banner is shown. The admin selects two teams from the Launch Match panel and clicks Launch Match, which calls POST /api/lobby/mixton-create-match with { teamIdA, teamIdB }. The bot creates the match in Discord, sends voice channels for both teams, and DMs all players.

Real-Time Sync

All open Mixton Arena panels are kept in sync via a WebSocket connection at:
wss://your-domain/api/lobby/mixton-ws?guildId=<guild-id>
The server broadcasts a state_update message to all connected clients whenever any lobby action modifies the state. The client updates lobbyState, availablePlayers, and commandEnabled in real time without a page refresh. If the WebSocket connection drops, the client automatically reconnects after 5 seconds. The HTTP upgrade is handled exclusively for the /api/lobby/mixton-ws path — all other upgrade requests are rejected.

Admin Controls

Admins have access to additional controls not available to captains:
ActionAPI EndpointDescription
Override player tierPOST /api/lobby/mixton-override-tierManually set a player’s tier to S/A/B/C
Assign player to teamPOST /api/lobby/mixton-assign-playerAdd a player directly to a team slot
Remove player from teamPOST /api/lobby/mixton-remove-playerRemove a player from a team and return them to the pool
Clear entire teamPOST /api/lobby/mixton-clear-teamRemove all players from a team, keeping its captain
Reset lobbyPOST /api/lobby/mixton-resetWipe the entire lobby state and start fresh
Reset ready queuePOST /api/lobby/mixton-reset-playersClear the available player pool (removes all /mixton_listo registrations)
Toggle commandPOST /api/lobby/mixton-toggle-commandEnable or disable the /mixton_listo Discord command
Use the tier override feature (POST /api/lobby/mixton-override-tier) to manually calibrate player tiers when ELO data is unavailable or when a player’s skill level doesn’t match their official Faceit ELO — for example, if they recently had their account reset or if their stats are from a smurf account. Overrides are stored in mixton_tier_override on the player record and persist until cleared.

Match History Sidebar

The history sidebar fetches the last 10 mixton matches from GET /api/lobby/matches-history and displays each match with team names, player rosters, and the match date. From any history entry you can:
  • View roster — expand a team to see all player nicknames and Discord mentions.
  • Load team into slot — click a team entry to open a modal prompting which current team slot to assign it to, then confirm to call POST /api/lobby/mixton-load-team with the captain’s Discord ID and the rest of the roster’s Discord IDs.
This allows quickly re-forming a team composition from a past match without manually reassigning each player.

Lobby State Shape

The full lobby state managed by the panel:
interface LobbyState {
  teams: Team[];         // All configured teams with captain and picks
  pickOrder: string[];   // Ordered array of team IDs for picks
  currentPickIndex: number; // Index into pickOrder for whose turn it is
  draftStarted: boolean;
  draftFinished: boolean;
}
State is persisted in Firestore under faceit_config/mixton_lobby_<guildId> and loaded fresh on each panel connection.

Build docs developers (and LLMs) love