diff --git a/src/handler/sern.ts b/src/handler/sern.ts index feaa609..5bbcc36 100644 --- a/src/handler/sern.ts +++ b/src/handler/sern.ts @@ -16,6 +16,7 @@ import type { InputCommandModule, InputEventModule, } from './plugins/plugin'; +import { SernError } from './structures/errors'; /** * @@ -71,14 +72,12 @@ export function commandModule(mod: InputCommandModule): CommandModule { export function eventModule(mod: InputEventModule): EventModule { const onEvent: EventModuleEventPluginDefs[EventType][] = []; const plugins: EventModuleCommandPluginDefs[EventType][] = []; - for (const pl of mod.plugins ?? []) { - if (pl.type === PluginType.Event) { - onEvent.push(pl); - } else { - plugins.push(pl); - } + const hasPlugins = mod.plugins && mod.plugins.length > 0; + if (hasPlugins) { + throw Error( + SernError.NotSupportedYet + `: Plugins on event listeners are not supported yet`, + ); } - return { ...mod, onEvent, diff --git a/src/handler/structures/errors.ts b/src/handler/structures/errors.ts index 86a90b0..6d6a898 100644 --- a/src/handler/structures/errors.ts +++ b/src/handler/structures/errors.ts @@ -5,5 +5,5 @@ export enum SernError { NotSupportedInteraction = `This interaction is not supported.`, PluginFailure = `A plugin failed to call controller.next()`, MismatchEvent = `You cannot use message when an interaction fired or vice versa`, - UndefinedSernEmitter = `Could not find an Emitter`, + NotSupportedYet = `This feature is not supported yet`, }