diff --git a/src/handler/events/interactionCreate.ts b/src/handler/events/interactionCreate.ts index 8e4fb46c..acf4b099 100644 --- a/src/handler/events/interactionCreate.ts +++ b/src/handler/events/interactionCreate.ts @@ -5,10 +5,8 @@ import * as Files from '../utilities/readFile'; import { match } from 'ts-pattern'; import { SernError } from '../structures/errors'; import Context from '../structures/context'; -import type { Result } from 'ts-results'; import { CommandType, controller } from '../sern'; -import type { Module, ModuleDefs} from '../structures/module'; -import type { EventPlugin } from '../plugins/plugin'; +import type { Module } from '../structures/module'; import { isButton, isChatInputCommand, diff --git a/src/handler/structures/module.ts b/src/handler/structures/module.ts index fbc9dbc3..9684142c 100644 --- a/src/handler/structures/module.ts +++ b/src/handler/structures/module.ts @@ -11,59 +11,67 @@ import type { Args } from '../../types/handler'; import type { CommandType } from '../sern'; import type { CommandPlugin, EventPlugin } from '../plugins/plugin'; import type Context from './context'; +import { Base } from 'discord.js'; +import type { PluginType } from '../plugins/plugin'; export interface BaseModule { + type : CommandType | PluginType name?: string; description: string; execute: (ctx: Context, args: Args) => Awaitable; } //possible refactoring types into interfaces and not types -export type TextCommand = { +export type TextCommand = Override[] plugins?: CommandPlugin[]; alias?: string[]; -} & BaseModule; +}>; -export type SlashCommand = { +export type SlashCommand = Override[] plugins?: (CommandPlugin)[]; options: ApplicationCommandOptionData[] | []; -} & BaseModule; -export type BothCommand = { +}>; + +export type BothCommand = Override[] plugins?: (CommandPlugin)[] alias?: string[]; options: ApplicationCommandOptionData[] | []; -} & BaseModule; +}>; -export type ContextMenuUser = { +export type ContextMenuUser = Override[]; plugins?: (CommandPlugin)[]; -} & Override Awaitable }>; + execute: (ctx: UserContextMenuCommandInteraction) => Awaitable +}> -export type ContextMenuMsg = { +export type ContextMenuMsg = Override[]; plugins?: CommandPlugin[]; -} & Override Awaitable }>; + execute: (ctx: MessageContextMenuCommandInteraction) => Awaitable +}>; -export type ButtonCommand = { +export type ButtonCommand = Override[]; plugins?: CommandPlugin[]; -} & Override Awaitable }>; + execute: (ctx: ButtonInteraction) => Awaitable +}>; -export type SelectMenuCommand = { +export type SelectMenuCommand = Override[]; plugins?: CommandPlugin[]; -} & Override Awaitable }>; + execute: (ctx: SelectMenuInteraction) => Awaitable +}>; export type Module = | TextCommand