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
Parameters
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 thecommand_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:fetchFaceitPlayer(nickname)— resolves the player’s profile, extractingplayer_id,avatar,country,nickname, and game-level data. ThrowsPLAYER_NOT_FOUNDif the nickname does not exist.fetchFaceitStats(player_id)— retrieves lifetime CS2 statistics. The command readsstats.lifetime['Average K/D Ratio'],stats.lifetime['Win Rate %'], andstats.lifetime['Matches'].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:| Field | Value |
|---|---|
| Title | 📊 Estadísticas de <nickname> (links to faceit.com/en/players/<nickname>) |
| Thumbnail | Player avatar (if set on their profile) |
| Nivel Faceit | Level <n> |
| ELO | Current ELO points |
| País | Country flag emoji (e.g. :flag_es:) |
| K/D | Lifetime average K/D ratio |
| Win Rate | Lifetime win rate percentage |
| Partidas | Total lifetime matches played |
| Últimas 5 | 🟢 (win) / 🔴 (loss) for each of the last 5 matches |
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) | Hex | Color |
|---|---|---|
| 1 – 3 | 0x8C8C8C | Grey |
| 4 – 7 | 0x15C253 | Green |
| 8 – 9 | 0xFF9E00 | Orange |
| 10 | 0xFF3E3E | Red |
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
| Condition | Error 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. |