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 /verificar_fc command is the entry point for every verified member on your server. It resolves a Faceit nickname against the Faceit Data API v4, confirms the player exists and has an active CS2 or CS:GO profile, checks for duplicate links across the guild, persists the relationship in the faceit_users Firestore collection, and — when autoRoleSync is enabled — immediately assigns the matching level role (1–10) in Discord. All sensitive API failures are returned as ephemeral messages visible only to the caller.

Syntax

/verificar_fc nickname:<your_faceit_nickname>

Parameters

nickname
string
required
Your exact Faceit username (case-insensitive lookup). Must match the nickname displayed on your Faceit profile page at https://www.faceit.com/en/players/<nickname>.

Feature Flag

This command is guarded by the command_verificar feature flag. When disabled, the bot replies with an ephemeral ❌ Este comando está desactivado por el administrador. and takes no further action.

Channel Restriction

The command must be run inside the configured link channel. The channel is read from settings.discordLinkChannelId (Firestore) with a fallback to the DISCORD_LINK_CHANNEL_ID environment variable. The value supports a comma-separated list of channel IDs, so you can allow verification in multiple channels simultaneously. Attempting to run /verificar_fc outside those channels returns an ephemeral error that mentions each allowed channel by mention (e.g. ❌ Este comando solo se puede usar en el canal de vinculación: #verificacion).
If DISCORD_LINK_CHANNEL_ID is not set or still contains the placeholder value ID_…, the bot refuses all verification attempts with a configuration error until an admin provides the correct channel ID.

Behavior

  1. Feature & channel guard — checked before any API call.
  2. API key validation — if FACEIT_API_KEY is absent or starts with TU_, the command fails immediately with a clear admin-facing error.
  3. Player lookup — calls fetchFaceitPlayer(nickname) against the Faceit Data API v4. Throws PLAYER_NOT_FOUND if the nickname does not exist.
  4. Duplicate detection — calls db.getDiscordIdByFaceitId(). If the Faceit account is already linked to this Discord user, a friendly ℹ️ notice is returned. If it is linked to another Discord user, the command fails with an error to prevent hijacking.
  5. Level extraction — reads player.games.cs2.faceit_elo (falls back to csgo). If no active game level is found, the command aborts.
  6. Persistence — calls db.linkAccounts(discordId, player_id, nickname, skillLevel, elo, guildId) and populates playerCache using the composite key ${guildId}_${discordId}.
  7. Role sync — if the autoRoleSync feature flag is active for the guild, calls syncMemberLevelRole(guild, discordId, skillLevel) to apply the correct level role immediately.
  8. Audit log — a success log entry is added via db.addLogEntry().

Response

The bot sends two messages on success:
  • An ephemeral reply to the caller:
    ✅ ¡Vinculación exitosa!
    
    Tu cuenta de Discord ahora está vinculada al perfil de Faceit [nickname](https://www.faceit.com/en/players/nickname) (Nivel 5).
    
  • A public notification sent to the link channel (fetched via guild.channels.fetch(linkChannelId)):
    ✨ ¡El usuario @User se ha verificado exitosamente con su perfil de Faceit [nickname](…) (Nivel 5)! 🎉
    
The public notification is best-effort — if the bot cannot fetch the channel (e.g. missing View Channel permission), it silently skips it without failing the command.

Error Reference

ConditionError message
command_verificar flag is false❌ Este comando está desactivado por el administrador.
Link channel not configured❌ El canal de vinculación no está configurado por el administrador.
Command run outside allowed channel❌ Este comando solo se puede usar en el canal de vinculación: #channel.
FACEIT_API_KEY missing/placeholder❌ El administrador no ha configurado la API Key de Faceit.
Nickname not found on Faceit❌ No se encontró ningún jugador con el nickname **X** en Faceit.
Faceit account already linked to another user❌ La cuenta de Faceit **X** ya está vinculada al usuario de Discord @User.
No active CS2/CS:GO level on profile❌ No se encontró nivel de CS2/CS:GO activo para tu perfil.
After linking, run /sincronizar_fc any time you need to force-refresh your level role without re-running the full verification flow.

Build docs developers (and LLMs) love