diff --git a/src/structures/Interaction.js b/src/structures/Interaction.js index 2afdacee023c..fa39123cc942 100644 --- a/src/structures/Interaction.js +++ b/src/structures/Interaction.js @@ -136,6 +136,14 @@ class Interaction extends Base { return Boolean(this.guildId && !this.guild && this.member); } + /** + * Indicates whether this interaction is a {@link BaseCommandInteraction}. + * @returns {boolean} + */ + isApplicationCommand() { + return InteractionTypes[this.type] === InteractionTypes.APPLICATION_COMMAND; + } + /** * Indicates whether this interaction is a {@link CommandInteraction}. * @returns {boolean} diff --git a/typings/index.d.ts b/typings/index.d.ts index 4816402f9216..9123c2cc94d2 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -1119,6 +1119,7 @@ export class Interaction extends Base { public inGuild(): this is GuildInteraction<'present'> & this; public inCachedGuild(): this is GuildInteraction<'cached'> & this; public inRawGuild(): this is GuildInteraction<'raw'> & this; + public isApplicationCommand(): this is BaseCommandInteraction; public isButton(): this is ButtonInteraction; public isCommand(): this is CommandInteraction; public isContextMenu(): this is ContextMenuInteraction;