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.

/stats is a public lookup command that fetches a Faceit player’s full career statistics and recent match history, then renders them in a colour-coded Discord embed. Any server member can query any Faceit player — the target does not need to be verified on the server. The response is always public so teammates can see stats in the channel.

Syntax

/stats nickname:<faceit_nickname>

Parameters

nickname
string
required
The exact Faceit nickname to look up. The search is case-insensitive at the API level but must otherwise match the player’s actual username on faceit.com.

Feature Flag

Guarded by the command_stats feature flag scoped to the guild. When disabled, the bot returns an ephemeral ❌ Este comando está desactivado por el administrador. without calling any external APIs.

Behavior

The command makes three sequential API calls to the Faceit Data API v4:
  1. fetchFaceitPlayer(nickname) — resolves the player’s profile, extracting player_id, avatar, country, nickname, and game-level data. Throws PLAYER_NOT_FOUND if the nickname does not exist.
  2. fetchFaceitStats(player_id) — retrieves lifetime CS2 statistics. The command reads stats.lifetime['Average K/D Ratio'], stats.lifetime['Win Rate %'], and stats.lifetime['Matches'].
  3. fetchPlayerHistory(player_id, 'cs2', 10) — retrieves the 10 most recent matches. Only the first 5 (history.items.slice(0, 5)) are used to build the recent-results indicator.

Embed Structure

The resulting embed has the following fields:
FieldValue
Title📊 Estadísticas de <nickname> (links to faceit.com/en/players/<nickname>)
ThumbnailPlayer avatar (if set on their profile)
Nivel FaceitLevel <n>
ELOCurrent ELO points
PaísCountry flag emoji (e.g. :flag_es:)
K/DLifetime average K/D ratio
Win RateLifetime win rate percentage
PartidasTotal lifetime matches played
Últimas 5🟢 (win) / 🔴 (loss) for each of the last 5 matches
Win/loss direction for each match is determined by checking whether player_id is in teams.faction1.players; if so, playerFaction is 'faction1', otherwise 'faction2'. The result is a win when m.results?.winner === playerFaction.

Embed Color by Level

The embed border color reflects the player’s Faceit level:
Level(s)HexColor
1 – 30x8C8C8CGrey
4 – 70x15C253Green
8 – 90xFF9E00Orange
100xFF3E3ERed

Response

The reply is public (ephemeral: false in deferReply) and uses interaction.deferReply() while the three API calls resolve. The final embed is sent with interaction.editReply({ embeds: [embed] }).
If the player has no lifetime stats available (stats.lifetime is empty or absent), the K/D, Win Rate, and Partidas fields will display N/D (no data). The embed is still sent — the missing fields do not cause an error.

Error Reference

ConditionError message
command_stats flag is false❌ Este comando está desactivado por el administrador. (ephemeral)
Nickname not found on Faceit❌ No se encontró el jugador **X** en Faceit.
Unexpected API error❌ Error al obtener estadísticas.
The /stats command works for any Faceit player worldwide — not just members of your Discord server or hub. You can look up opponents or pro players by entering their exact Faceit nickname.

Build docs developers (and LLMs) love