From c98425da14e7e2b39aa7749f4f677e69aec0c546 Mon Sep 17 00:00:00 2001 From: Jacob Nguyen <76754747+jacoobes@users.noreply.github.com> Date: Mon, 22 Aug 2022 19:45:30 -0500 Subject: [PATCH] revert: remove unneeded type predicates --- src/handler/utilities/predicates.ts | 46 ----------------------------- 1 file changed, 46 deletions(-) diff --git a/src/handler/utilities/predicates.ts b/src/handler/utilities/predicates.ts index d70b37d..118d39d 100644 --- a/src/handler/utilities/predicates.ts +++ b/src/handler/utilities/predicates.ts @@ -1,17 +1,5 @@ -import { - AutocompleteInteraction, - Interaction, - InteractionType, - type ModalSubmitInteraction, - type ButtonInteraction, - type SelectMenuInteraction, - type ChatInputCommandInteraction, - type UserContextMenuCommandInteraction, - type MessageContextMenuCommandInteraction, -} from 'discord.js'; import type { DiscordEventCommand, - ExternalEventCommand, SernEventCommand, } from '../structures/events'; import { EventType } from '../..'; @@ -26,26 +14,6 @@ export function correctModuleType( return plug !== undefined && (plug.type & type) !== 0; } -export function isApplicationCommand( - interaction: Interaction, -): interaction is - | ChatInputCommandInteraction - | UserContextMenuCommandInteraction - | MessageContextMenuCommandInteraction { - return interaction.type === InteractionType.ApplicationCommand; -} - -export function isModalSubmit(interaction: Interaction): interaction is ModalSubmitInteraction { - return interaction.type === InteractionType.ModalSubmit; -} -export function isAutocomplete(interaction: Interaction): interaction is AutocompleteInteraction { - return interaction.type === InteractionType.ApplicationCommandAutocomplete; -} -export function isMessageComponent( - interaction: Interaction, -): interaction is ButtonInteraction | SelectMenuInteraction { - return interaction.type === InteractionType.MessageComponent; -} export function isDiscordEvent(el: EventModule): el is DiscordEventCommand { return el.type === EventType.Discord; @@ -54,17 +22,3 @@ export function isSernEvent(el: EventModule): el is SernEventCommand { return el.type === EventType.Sern; } -export function isExternalEvent(el: EventModule): el is ExternalEventCommand { - return el.type === EventType.External && 'emitter' in el; -} - -// export function isEventPlugin( -// e: CommandModulePlugin, -// ): e is EventPlugin { -// return e.type === PluginType.Event; -// } -// export function isCommandPlugin( -// e: CommandModulePlugin, -// ): e is CommandPlugin { -// return !isEventPlugin(e); -// }