fix: pass the command type to pending interactions map

This commit is contained in:
CyberL1 2025-10-18 14:13:17 +02:00 committed by Rory&
parent 38ab40c637
commit 2480aa2d94
2 changed files with 5 additions and 3 deletions

View File

@ -20,7 +20,7 @@ import { randomBytes } from "crypto";
import { InteractionSchema } from "@spacebar/schemas"; import { InteractionSchema } from "@spacebar/schemas";
import { route } from "@spacebar/api"; import { route } from "@spacebar/api";
import { Request, Response, Router } from "express"; 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"; import { pendingInteractions } from "../../../util/imports/Interactions";
const router = Router({ mergeParams: true }); const router = Router({ mergeParams: true });
@ -73,6 +73,7 @@ router.post("/", route({}), async (req: Request, res: Response) => {
guildId: body.guild_id, guildId: body.guild_id,
channelId: body.channel_id, channelId: body.channel_id,
type: body.type, type: body.type,
commandType: body.data.type,
commandName: body.data.name, commandName: body.data.name,
}); });

View File

@ -17,7 +17,7 @@
*/ */
import { ApplicationCommandType } from "@spacebar/schemas"; import { ApplicationCommandType } from "@spacebar/schemas";
import { Snowflake } from "@spacebar/util"; import { InteractionType, Snowflake } from "@spacebar/util";
interface PendingInteraction { interface PendingInteraction {
timeout: NodeJS.Timeout; timeout: NodeJS.Timeout;
@ -25,7 +25,8 @@ interface PendingInteraction {
channelId?: string; channelId?: string;
guildId?: string; guildId?: string;
nonce?: string; nonce?: string;
type: ApplicationCommandType; type: InteractionType;
commandType: ApplicationCommandType;
commandName: string; commandName: string;
} }