feat!: new module resolution algorithm

This commit is contained in:
Jacob Nguyen
2023-05-04 18:45:54 -05:00
parent e2fd44516a
commit faa0b4882e
9 changed files with 213 additions and 303 deletions

View File

@@ -1,7 +1,3 @@
import type { CommandModule } from '../../types/module';
import type { Processed } from '../../types/handler';
import { ApplicationCommandType, ComponentType } from './enums';
/**
* @since 2.0.0
@@ -9,20 +5,7 @@ import { ApplicationCommandType, ComponentType } from './enums';
* This dependency is usually injected into ModuleManager
*/
export class ModuleStore {
readonly BothCommands = new Map<string, Processed<CommandModule>>();
readonly ApplicationCommands = {
[ApplicationCommandType.User]: new Map<string, Processed<CommandModule>>(),
[ApplicationCommandType.Message]: new Map<string, Processed<CommandModule>>(),
[ApplicationCommandType.ChatInput]: new Map<string, Processed<CommandModule>>(),
};
readonly ModalSubmit = new Map<string, Processed<CommandModule>>();
readonly TextCommands = new Map<string, Processed<CommandModule>>();
readonly InteractionHandlers = {
[ComponentType.Button]: new Map<string, Processed<CommandModule>>(),
[ComponentType.StringSelect]: new Map<string, Processed<CommandModule>>(),
[ComponentType.ChannelSelect]: new Map<string, Processed<CommandModule>>(),
[ComponentType.MentionableSelect]: new Map<string, Processed<CommandModule>>(),
[ComponentType.RoleSelect]: new Map<string, Processed<CommandModule>>(),
[ComponentType.UserSelect]: new Map<string, Processed<CommandModule>>(),
};
readonly Commands = new Map<string, string>();
}