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.

/desvincular_fc gives server administrators a clean way to sever the bond between a Discord member and their Faceit account. It calls db.unlinkAccount() to remove the record from the faceit_users Firestore collection and then calls removeAllFaceitRoles() to strip every Faceit-managed role — all ten level roles and any special club roles — from the target member. The command is intentionally public so the action is visible to the moderation team.

Syntax

/desvincular_fc usuario:@DiscordUser

Parameters

usuario
user mention
required
The Discord member to unlink. Must be a member of the current guild. If the member has already left the server the role-removal step is skipped silently, but the Firestore record is still deleted.

Required Permissions

The caller must satisfy at least one of the following:
  • Hold a Discord role whose name matches ADMIN_ROLE_NAME (default: ADMIN). The check is case-insensitive and performed via checkIsAdmin().
  • Have the Discord Administrator permission on the server.
Regular members who invoke this command receive an ephemeral ❌ No tienes permisos para usar este comando. Se requiere el rol **ADMIN**. error.

Feature Flag

Guarded by the command_desvincular feature flag scoped to the guild. When the flag is false, the bot returns an ephemeral error and performs no database changes.

Channel Restriction

Like /verificar_fc, this command must be run inside the configured link channel (DISCORD_LINK_CHANNEL_ID / settings.discordLinkChannelId). Comma-separated multi-channel values are supported. Attempting to use it in another channel produces an ephemeral error listing the allowed channels by mention.
If DISCORD_LINK_CHANNEL_ID is not properly set (placeholder value or empty), the command is locked for everyone, including administrators.

Behavior

  1. Feature flag check — checked first, before permission or channel validation.
  2. Channel guard — validates that the command was issued in an allowed link channel.
  3. Permission check — calls checkIsAdmin(member, guild).
  4. Target resolution — reads interaction.options.getUser('usuario') and fetches the corresponding GuildMember object.
  5. Unlink — calls db.unlinkAccount(targetUserId, guildId). This removes the Firestore document from faceit_users.
  6. Role removal — if the target member is still in the server, calls removeAllFaceitRoles(targetMember, guild). This iterates and removes all level roles (Level 1–10) as well as any configured club/special roles. The number of roles removed is logged at INFO level.
  7. Audit log — writes a warn log entry recording the admin who performed the action and the target user’s tag.

Response

On success the bot sends a public reply (ephemeral: false) in the link channel:
✅ El usuario @TargetUser ha sido desvinculado de Faceit con éxito y sus roles asociados fueron removidos.
The reply is non-ephemeral so that moderation activity is transparent to anyone monitoring the channel.

Error Reference

ConditionError message
command_desvincular 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.
Caller lacks admin permissions❌ No tienes permisos para usar este comando. Se requiere el rol **ADMIN**.
Unexpected DB or Discord API error❌ Ocurrió un error al intentar desvincular al usuario: <details>
If the target user has already left the guild, guild.members.fetch() returns null. The Firestore unlink still happens, but the role-removal step is skipped since there is no guild member object to act on.
After unlinking a user, they can immediately re-run /verificar_fc to link again with the same or a different Faceit account. No cooldown or block is applied.

Build docs developers (and LLMs) love