diff --git a/src/handler/sern.ts b/src/handler/sern.ts index 1af5572..0e7a36b 100644 --- a/src/handler/sern.ts +++ b/src/handler/sern.ts @@ -3,7 +3,7 @@ import { Err, Ok } from 'ts-results-es'; import { ExternalEventEmitters } from './utilities/readFile'; import type { EventEmitter } from 'events'; import { processEvents } from './events/userDefinedEventsHandling'; -import { EventType, PluginType } from './structures/enums'; +import { CommandType, EventType, PluginType } from './structures/enums'; import type { CommandPlugin, EventModuleCommandPluginDefs, @@ -17,6 +17,9 @@ import InteractionHandler from './events/interactionHandler'; import ReadyHandler from './events/readyHandler'; import MessageHandler from './events/messageHandler'; import type { CommandModule, EventModule } from '../types/module'; +import type { ModuleStore } from './structures/moduleStore'; +import type { Client } from 'discord.js'; +import type { ModuleConfig, ModuleManagerConstructor } from './contracts/moduleManager'; /** * @@ -119,3 +122,10 @@ export function eventModule(mod: InputEventModule): EventModule { plugins, } as EventModule; } + +export function ModuleConfiguration( + moduleManager : ModuleManagerConstructor, + moduleStore: T, +) : ModuleConfig { + return ( client: Client ) => new moduleManager(client, moduleStore); +} \ No newline at end of file diff --git a/src/handler/structures/defaultModuleManager.ts b/src/handler/structures/defaultModuleManager.ts new file mode 100644 index 0000000..485cd87 --- /dev/null +++ b/src/handler/structures/defaultModuleManager.ts @@ -0,0 +1,15 @@ +import ModuleManager from '../contracts/moduleManager'; +import type { CommandModule, CommandModuleDefs } from '../../types/module'; +import type { CommandType } from './enums'; + +export class DefaultModuleManager extends ModuleManager { + getModule(type: T, name: string): CommandModuleDefs[T] | undefined { + return undefined; + } + + setModule(type: T, value: CommandModule): void { + } + +} + +