diff --git a/src/core/structures/context.ts b/src/core/structures/context.ts index db35ba9..5d8e05d 100644 --- a/src/core/structures/context.ts +++ b/src/core/structures/context.ts @@ -9,9 +9,13 @@ export abstract class Context { } +function safeUnwrap(res: Either) { + return res.val; +} + export function wrap( val: Left|Right, - fa: (val: Left|Right -) => Either) { + fa: (val: Left|Right) => Either +) { return fa(val); } diff --git a/src/core/structures/moduleStore.ts b/src/core/structures/moduleStore.ts index 856c012..128cdcf 100644 --- a/src/core/structures/moduleStore.ts +++ b/src/core/structures/moduleStore.ts @@ -1,7 +1,23 @@ import type { CommandModule } from '../../types/module'; -import { ApplicationCommandType, ComponentType } from 'discord.js'; import type { Processed } from '../../types/handler'; +const enum ApplicationCommandType { + User, + Message, + ChatInput +} + +const enum ComponentType { + ActionRow = 1, + Button = 2, + StringSelect = 3, + TextInput = 4, + UserSelect = 5, + RoleSelect = 6, + MentionableSelect = 7, + ChannelSelect = 8, +} + /** * @since 2.0.0 * Storing all command modules