refactor: remove dependence on discord.js for module stoore

This commit is contained in:
jacoobes
2023-04-14 12:17:11 -05:00
parent b40f8905ea
commit 457cb25cb2
2 changed files with 23 additions and 3 deletions

View File

@@ -9,9 +9,13 @@ export abstract class Context<Left, Right> {
}
function safeUnwrap<T>(res: Either<T, T>) {
return res.val;
}
export function wrap<Left, Right>(
val: Left|Right,
fa: (val: Left|Right
) => Either<Left, Right>) {
fa: (val: Left|Right) => Either<Left, Right>
) {
return fa(val);
}

View File

@@ -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