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 support system provides two pathways for players to reach server staff during an active Faceit match: the /llamar_admin slash command for direct in-game notification, and the /setup_soporte command that deploys a persistent button panel to a dedicated support channel. Both are gated by the adminCallNotifications feature flag. Additionally, the text triggers !admin, !soporte, and !llamaradmin provide a keyboard-friendly fallback that works in any channel.

/llamar_admin

/llamar_admin lets a verified player who is currently in an active Faceit match alert every admin on the server simultaneously via direct messages. The bot looks up the player’s active match from Firestore, builds a rich embed with the match URL and details, and sends it as a DM to each admin individually by iterating the admin collection.

Syntax

/llamar_admin
No parameters.

Feature Flag

Guarded by adminCallNotifications scoped to the guild. When disabled, the bot returns an ephemeral ❌ La función de llamada a admin está desactivada.

Prerequisites

  • A linked Faceit account (run /verificar_fc first). The command reads faceit_player_id via db.getFaceitIdByDiscordId().
  • An active match currently tracked in Firestore for that player. The bot calls db.getActiveMatchByPlayerId(faceit_player_id) — if no match is found, it returns an error.

Behavior

  1. Feature flag check — aborts if adminCallNotifications is disabled.
  2. Link check — reads the caller’s faceit_player_id from Firestore.
  3. Active match lookup — calls db.getActiveMatchByPlayerId(faceit_player_id). Aborts if no active match exists.
  4. Admin discovery — searches for a role whose name matches ADMIN_ROLE_NAME (env var, default ADMIN). If no such role exists or it has no members, falls back to all members with the Discord Administrator permission.
  5. DM broadcast — iterates the admin collection and sends each admin a DM embed:
    • 🚨 Solicitud de Admin title
    • Player’s Discord tag and Faceit nickname
    • Direct hyperlink to the Faceit match room (https://www.faceit.com/en/cs2/room/<matchId>)
    • Match details: team names, map, server location
    • Caller’s Discord mention and channel
  6. Audit log — writes a warn log entry with the count of DMs sent vs. admins found.
  7. Ephemeral reply — the caller receives a private confirmation.
DM failures (e.g. admin has DMs disabled) are caught and logged as warnings; the count of successfully sent DMs is reported to the caller.

Response

Ephemeral reply to the caller:
✅ Se ha notificado a 3 admin(s). Te atenderán pronto.

Error Reference

ConditionError message
adminCallNotifications disabled❌ La función de llamada a admin está desactivada. (ephemeral)
No linked Faceit account❌ No tienes una cuenta de Faceit vinculada. Usa /verificar_fc para vincularla.
Not in an active match❌ No estás en ninguna partida activa en este momento.
No admins found on server⚠️ No hay admins disponibles para atender tu solicitud.
Command used outside a guild❌ Este comando solo funciona dentro de un servidor.
Unexpected error❌ Error al procesar tu solicitud. Intenta de nuevo.

/setup_soporte

/setup_soporte deploys a persistent support panel to the current channel. The panel contains an embed explaining the support requirements and a single 🚨 Llamar Administrador button. Any verified player in an active match can press the button, which opens a modal for them to describe their problem before alerting staff.

Syntax

/setup_soporte
No parameters.

Required Permission

The command uses setDefaultMemberPermissions(PermissionFlagsBits.Administrator) in its builder, so it is only visible and executable by members with the Discord Administrator permission. Regular members cannot see or invoke it.

Feature Flag

Also guarded by adminCallNotifications. When disabled, returns an ephemeral error without sending the panel.

Behavior

  1. Feature flag check — aborts if adminCallNotifications is disabled.
  2. Template resolution — calls db.getMessageTemplates() to allow server admins to customise the panel. Defaults:
    • Title: 🚨 Soporte y Llamado de Admin
    • Description: Multi-line explanation of requirements (Faceit link, active match, what happens when the button is pressed)
    • Color: #FF0000
  3. Embed + button construction — builds an EmbedBuilder and an ActionRowBuilder with a ButtonStyle.Danger button (customId: 'llamar_admin_btn').
  4. Channel post — sends the embed and button row to the current channel via interaction.reply().

The Button Flow

When a player presses Llamar Administrador (llamar_admin_btn):
  1. A modal is shown (interactionCreate.js button handler) asking the player to describe their problem. The text input requires between 10 and 500 characters (setMinLength(10).setMaxLength(500)).
  2. On modal submit, the bot creates a support call record in Firestore.
  3. A notification embed is sent to DISCORD_ADMIN_ALERTS_CHANNEL_ID pinging the ADMIN role and including an “Atender Solicitud” button for staff to acknowledge the request.

Auto-Deployment on Startup

If DISCORD_SUPPORT_CHANNEL_ID is configured, the bot’s ready event handler calls checkAndDeploySupportPanel() which automatically posts (or skips if a panel already exists) the support panel to that channel on startup. You only need to run /setup_soporte manually when deploying the panel to an additional channel or after the original message is deleted.
The support panel embed content (title, description, and color) can be customised via the messageTemplates document in Firestore — no code changes needed. Changes take effect the next time /setup_soporte is run or the bot restarts.

Text Command Triggers

In addition to the slash command, typing any of the following text messages triggers the admin notification flow via the messageCreate event handler:
!admin
!soporte
!llamaradmin
These provide a quick fallback for players unfamiliar with slash commands. The notification behavior is identical to /llamar_admin — the bot looks up the player’s active match and DMs all admins.
Text triggers require the bot to have the Message Content intent enabled in the Discord Developer Portal. Without this intent, the bot cannot read message content and text triggers will not work.

/info

The /info command displays a quick-reference embed with your server’s Faceit Club link, the verification channel, and shortcuts to /leaderboard and /stats. It is gated by the command_info feature flag and responds publicly (ephemeral: false). No parameters are required.
Deploy the support panel in a dedicated read-only channel so it stays pinned at the top and players can always find the button. Set the channel name to something visible like #soporte or #llamar-admin.

Build docs developers (and LLMs) love