From 04dfa8237117b315e4f2a47542c254819e515dc8 Mon Sep 17 00:00:00 2001 From: Jacob Nguyen <76754747+jacoobes@users.noreply.github.com> Date: Sun, 5 Jun 2022 13:24:06 -0500 Subject: [PATCH] fix: Remove type reduction to never in onReady.ts --- babel.config.js | 3 --- src/handler/structures/module.ts | 22 +++++++++++----------- 2 files changed, 11 insertions(+), 14 deletions(-) delete mode 100644 babel.config.js diff --git a/babel.config.js b/babel.config.js deleted file mode 100644 index a3092ab..0000000 --- a/babel.config.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - presets: [['@babel/preset-env', { targets: { node: 'current' } }], '@babel/preset-typescript'], -}; diff --git a/src/handler/structures/module.ts b/src/handler/structures/module.ts index 3a31353..5075471 100644 --- a/src/handler/structures/module.ts +++ b/src/handler/structures/module.ts @@ -26,7 +26,7 @@ export interface BaseModule { type: CommandType | PluginType; name?: string; description: string; - execute: (...args: unknown[]) => Awaitable; + execute: (ctx: Context, args: Args) => Awaitable; } //possible refactoring types into interfaces and not types @@ -35,9 +35,9 @@ export type TextCommand = Override< { type: CommandType.Text; onEvent: EventPlugin[]; //maybe allow BothPlugins for this also? - plugins: CommandPlugin[]; //maybe allow BothPlugins for this also? + plugins: CommandPlugin[]; //maybe allow BothPlugins for this also? alias?: string[]; - execute: (ctx: Context, args: ['text', string[]]) => Awaitable; + execute: (ctx: Context, args: Args) => Awaitable; } >; @@ -46,9 +46,9 @@ export type SlashCommand = Override< { type: CommandType.Slash; onEvent: EventPlugin[]; //maybe allow BothPlugins for this also? - plugins: CommandPlugin[]; //maybe allow BothPlugins for this also? + plugins: CommandPlugin[]; //maybe allow BothPlugins for this also? options?: SernOptionsData[]; - execute: (ctx: Context, args: ['slash', SlashOptions]) => Awaitable; + execute: (ctx: Context, args: Args) => Awaitable; } >; @@ -57,7 +57,7 @@ export type BothCommand = Override< { type: CommandType.Both; onEvent: EventPlugin[]; - plugins: CommandPlugin[]; + plugins: CommandPlugin[]; alias?: string[]; options?: SernOptionsData[]; execute: (ctx: Context, args: Args) => Awaitable; @@ -69,7 +69,7 @@ export type ContextMenuUser = Override< { type: CommandType.MenuUser; onEvent: EventPlugin[]; - plugins: CommandPlugin[]; + plugins: CommandPlugin[]; execute: (ctx: UserContextMenuCommandInteraction) => Awaitable; } >; @@ -79,7 +79,7 @@ export type ContextMenuMsg = Override< { type: CommandType.MenuMsg; onEvent: EventPlugin[]; - plugins: CommandPlugin[]; + plugins: CommandPlugin[]; execute: (ctx: MessageContextMenuCommandInteraction) => Awaitable; } >; @@ -89,7 +89,7 @@ export type ButtonCommand = Override< { type: CommandType.Button; onEvent: EventPlugin[]; - plugins: CommandPlugin[]; + plugins: CommandPlugin[]; execute: (ctx: ButtonInteraction) => Awaitable; } >; @@ -99,7 +99,7 @@ export type SelectMenuCommand = Override< { type: CommandType.MenuSelect; onEvent: EventPlugin[]; - plugins: CommandPlugin[]; + plugins: CommandPlugin[]; execute: (ctx: SelectMenuInteraction) => Awaitable; } >; @@ -109,7 +109,7 @@ export type ModalSubmitCommand = Override< { type: CommandType.Modal; onEvent: EventPlugin[]; - plugins: CommandPlugin[]; + plugins: CommandPlugin[]; execute: (ctx: ModalSubmitInteraction) => Awaitable; } >;