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.

/sincronizar_fc lets any verified member pull their latest Faceit data on demand and immediately re-apply the correct level role in Discord. It is useful after a rank-up or rank-down that the bot’s automatic background sync may not yet have processed, or after a server restart that cleared the in-memory playerCache. The command hits the Faceit Data API v4 directly using the stored player_id, so the nickname does not need to be re-entered.

Syntax

/sincronizar_fc
This command accepts no parameters.

Feature Flag

Guarded by the command_sincronizar feature flag scoped to the guild. When the flag is false, the bot replies with an ephemeral ❌ Este comando está desactivado por el administrador. and performs no further action.

Prerequisites

  • You must have already linked your Faceit account using /verificar_fc. The command reads your faceit_player_id from the faceit_users Firestore collection via db.getFaceitIdByDiscordId(). If no link is found it returns an error directing you to run /verificar_fc first.
  • FACEIT_API_KEY must be configured in the environment. If it is absent or starts with the placeholder prefix TU_, the command fails immediately.

Behavior

  1. Feature flag check — aborts early if command_sincronizar is disabled for the guild.
  2. Link lookup — calls db.getFaceitIdByDiscordId(discordId, guildId). Returns an error if no link exists.
  3. Faceit API call — calls fetchFaceitPlayerById(faceitPlayerId) to retrieve the current player object. Reads skill_level via getPlayerSkillLevel(player) and parses player.games.cs2.faceit_elo (with a csgo fallback).
  4. Role sync — calls syncMemberLevelRole(guild, discordId, skillLevel) which removes any stale level roles (1–10) and adds the current one.
  5. Cache update — refreshes playerCache using the caller’s discordId as the key with the latest { faceitId, nickname, level } data.
  6. Audit log — writes an info log entry recording the manual sync and the resolved level.

Response

The bot replies with an ephemeral embed containing your up-to-date details:
✅ ¡Sincronización completa!

Tu cuenta de Discord @User está sincronizada con el perfil de Faceit NickName.
🎮 Nivel Faceit: Level 7
⚡ ELO: 1842 ELO
The reply is always ephemeral — only you can see it.

Error Reference

ConditionError message
command_sincronizar flag is false❌ Este comando está desactivado por el administrador.
FACEIT_API_KEY missing/placeholder❌ El administrador no ha configurado la API Key de Faceit.
No linked account found❌ No tienes una cuenta de Faceit vinculada. Usa /verificar_fc primero para vincular tu cuenta.
No active CS2/CS:GO level on profile❌ No se pudo encontrar un nivel activo en Faceit para el perfil **NickName**.
Unexpected API or DB error❌ Ocurrió un error al intentar sincronizar tu cuenta: <details>
If you changed your Faceit nickname, this command will not update the stored nickname in Firestore. Use /desvincular_fc (admin) followed by a fresh /verificar_fc to update the nickname binding.
Automatic role sync fires on every Faceit match completion event received by the bot. /sincronizar_fc is only needed when the automatic path is delayed or you want an immediate confirmation of your current level.

Build docs developers (and LLMs) love