Skip to content

Commit 1348aaf

Browse files
fix: correct isCommand type and add isRepliable method
1 parent 00dbe41 commit 1348aaf

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

src/structures/Interaction/BaseInterction.ts

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ import type { StringSelectMenuInteraction } from "../Interaction/MessageComponen
6262
import type { ButtonInteraction } from "../Interaction/MessageComponentInteraction/ButtonInteraction.js";
6363

6464
// Interaction Base
65-
import type { CommandInteraction as ApplicationCommandInteraction } from "../Interaction/ApplicationCommandInteraction/CommandInteractionBase.js";
65+
import type { CommandInteraction } from "../Interaction/ApplicationCommandInteraction/CommandInteractionBase.js";
6666
import type { MessageComponentInteraction } from "../Interaction/MessageComponentInteraction/Base.js";
6767
import type { ContextMenuInteraction } from "./ApplicationCommandInteraction/ContextMenuInteraction/Base.js";
6868

@@ -259,9 +259,9 @@ export class BaseInteraction {
259259
}
260260

261261
/**
262-
* Indicates whether this interaction is a {@link ChatInputCommandInteraction}
262+
* Indicates whether this interaction is a {@link CommandInteraction}
263263
*/
264-
isCommand(): this is ChatInputCommandInteraction {
264+
isCommand(): this is CommandInteraction {
265265
return this.type === InteractionType.ApplicationCommand;
266266
}
267267

@@ -416,13 +416,17 @@ export class BaseInteraction {
416416
);
417417
}
418418

419-
// /**
420-
// * Indicates whether this interaction can be replied to.
421-
// */
422-
// isRepliable() {
423-
// return ![
424-
// InteractionType.Ping,
425-
// InteractionType.ApplicationCommandAutocomplete,
426-
// ].includes(this.type);
427-
// }
419+
/**
420+
* Indicates whether this interaction can be replied to.
421+
*/
422+
isRepliable(): this is
423+
| ChatInputCommandInteraction
424+
| ContextMenuInteraction
425+
| MessageComponentInteraction
426+
| ModalSubmitInteraction {
427+
return ![
428+
InteractionType.Ping,
429+
InteractionType.ApplicationCommandAutocomplete,
430+
].includes(this.type);
431+
}
428432
}

0 commit comments

Comments
 (0)