fix: pass the command type to pending interactions map
This commit is contained in:
parent
38ab40c637
commit
2480aa2d94
@ -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,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user