Interfazhost
DiscordInteractionContext
Evento que recibe un hook DISCORD_INTERACTION (Interactions por HTTP): vista SANEADA de la interaccion, sin el token de la interaccion. Devuelve
{ respond: { content?, embeds?, ephemeral? } } (mensaje), { update: { content?, embeds? } } (editar el mensaje de un componente), { choices: [{ name, value }] }
(autocompletar) o { defer: true, ephemeral? } (responder despues: el nucleo vuelve a llamar con ctx.phase === "deferred" hasta 20 s y envia el respond).
El handler corre en modo publico: sin ctx.services ni ctx.libs; la primera fase tiene 2,5 s (Discord exige responder en 3 s).
Firma
export interface DiscordInteractionContext {
phase: "interaction" | "deferred";
interaction: { id: string; kind: "command" | "component" | "autocomplete" | "modal"; applicationId: string; guildId: string | null; channelId: string | null; locale: string | null; messageId: string | null; user: { id: string; username: string; globalName: string | null; } | null; memberRoles: string[]; command?: { id: string | null; name: string; type: number; options: Array<{ name: string; type: number; value?: string | number | boolean; focused?: boolean; options?: unknown[]; }>; }; component?: { customId: string; type: number; values: string[]; }; modal?: { customId: string; fields: Array<{ customId: string; value: string; }>; }; };
}Miembros (2)
| Nombre | Tipo | Descripción |
|---|---|---|
| phaseobligatorio | "interaction" | "deferred" | Sin descripción. |
| interactionobligatorio | { id: string; kind: "command" | "component" | "autocomplete" | "modal"; applicationId: string; guildId: string | null; channelId: string | null; locale: string | null; messageId: string | null; user: { id: string; username: string; globalName: string | null; } | null; memberRoles: string[]; command?: { id: string | null; name: string; type: number; options: Array<{ name: string; type: number; value?: string | number | boolean; focused?: boolean; options?: unknown[]; }>; }; component?: { customId: string; type: number; values: string[]; }; modal?: { customId: string; fields: Array<{ customId: string; value: string; }>; }; } | Sin descripción. |
Usado en / Referenciado por
Nada todavía.
Fuente: bloomx-extensions/_shared/sdk/ctx.d.ts:760 · ctx.d.ts