diff --git a/src/handler/events/readyEvent.ts b/src/handler/events/readyEvent.ts index 224a2ae..a728ed3 100644 --- a/src/handler/events/readyEvent.ts +++ b/src/handler/events/readyEvent.ts @@ -29,11 +29,11 @@ export const onReady = (wrapper: Wrapper) => { const ready$ = fromEvent(client, 'ready').pipe(take(1), skip(1)); const processCommandFiles$ = Files.buildData(commands).pipe( map(({ mod, absPath }) => { - if (mod?.name === undefined) { - const name = Files.fmtFileName(basename(absPath)); - return { name, ...mod }; - } - return mod; + return { + name: mod?.name ?? Files.fmtFileName(basename(absPath)), + description: mod?.description ?? '...', + ...mod, + }; }), ); const processPlugins$ = processCommandFiles$.pipe( @@ -59,7 +59,7 @@ export const onReady = (wrapper: Wrapper) => { ( concat(ready$, processPlugins$) as Observable<{ - mod: DefinitelyDefined; + mod: DefinitelyDefined; cmdPluginsRes: { execute: Awaitable>; type: PluginType.Command; diff --git a/src/handler/structures/module.ts b/src/handler/structures/module.ts index 5afc91c..b28a973 100644 --- a/src/handler/structures/module.ts +++ b/src/handler/structures/module.ts @@ -25,7 +25,7 @@ import type { ApplicationCommandOptionType } from 'discord.js'; export interface BaseModule { type: CommandType | PluginType; name?: string; - description: string; + description?: string; execute: (ctx: Context, args: Args) => Awaitable; }