diff --git a/src/types/channels/threads/is_slash_command.ts b/src/types/channels/threads/is_slash_command.ts new file mode 100644 index 000000000..9fedf32c1 --- /dev/null +++ b/src/types/channels/threads/is_slash_command.ts @@ -0,0 +1,7 @@ +import { Interaction, SlashCommandInteraction } from "../../interactions/interaction.ts"; +import { DiscordInteractionTypes } from "../../interactions/interaction_types.ts"; + +/** A type guard function to tell if it is a slash command interaction */ +export function isSlashCommand(interaction: Interaction): interaction is SlashCommandInteraction { + return interaction.type === DiscordInteractionTypes.ApplicationCommand; +}