add: isSlashCommand typeGuard

This commit is contained in:
ITOH
2021-06-13 21:45:36 +02:00
parent 2499a036b4
commit 188ffdc1f8
@@ -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;
}