From 2480aa2d947555e03538a8671fc1269c2f5d5b66 Mon Sep 17 00:00:00 2001 From: CyberL1 Date: Sat, 18 Oct 2025 14:13:17 +0200 Subject: [PATCH] fix: pass the command type to pending interactions map --- src/api/routes/interactions/index.ts | 3 ++- src/util/imports/Interactions.ts | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/api/routes/interactions/index.ts b/src/api/routes/interactions/index.ts index 815d2b86..8789b291 100644 --- a/src/api/routes/interactions/index.ts +++ b/src/api/routes/interactions/index.ts @@ -20,7 +20,7 @@ import { randomBytes } from "crypto"; import { InteractionSchema } from "@spacebar/schemas"; import { route } from "@spacebar/api"; import { Request, Response, Router } from "express"; -import { Application, ApplicationCommand, emitEvent, InteractionCreateEvent, InteractionFailureEvent, Snowflake } from "@spacebar/util"; +import { emitEvent, InteractionCreateEvent, InteractionFailureEvent, Snowflake } from "@spacebar/util"; import { pendingInteractions } from "../../../util/imports/Interactions"; const router = Router({ mergeParams: true }); @@ -73,6 +73,7 @@ router.post("/", route({}), async (req: Request, res: Response) => { guildId: body.guild_id, channelId: body.channel_id, type: body.type, + commandType: body.data.type, commandName: body.data.name, }); diff --git a/src/util/imports/Interactions.ts b/src/util/imports/Interactions.ts index d4770a49..dd3ca515 100644 --- a/src/util/imports/Interactions.ts +++ b/src/util/imports/Interactions.ts @@ -17,7 +17,7 @@ */ import { ApplicationCommandType } from "@spacebar/schemas"; -import { Snowflake } from "@spacebar/util"; +import { InteractionType, Snowflake } from "@spacebar/util"; interface PendingInteraction { timeout: NodeJS.Timeout; @@ -25,7 +25,8 @@ interface PendingInteraction { channelId?: string; guildId?: string; nonce?: string; - type: ApplicationCommandType; + type: InteractionType; + commandType: ApplicationCommandType; commandName: string; }