Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/handler/events/readyHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export default class ReadyHandler extends EventsHandler<{
type: PluginType.Command;
}[];
}) {
if ((mod.plugins || []).length === 0) {
if (mod.plugins.length === 0) {
return of({ mod, pluginRes: [] });
}
// modules with no event plugins are ignored in the previous
Expand Down
2 changes: 1 addition & 1 deletion src/handler/events/userDefinedEventsHandling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function processCommandPlugins<T extends DefinedCommandModule>(
wrapper: Wrapper,
payload: { mod: T; absPath: string },
) {
return (payload.mod.plugins || []).map(plug => ({
return payload.mod.plugins.map(plug => ({
...plug,
name: plug?.name ?? 'Unnamed Plugin',
description: plug?.description ?? '...',
Expand Down
5 changes: 0 additions & 5 deletions src/handler/utilities/readFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,6 @@ export function buildData<T>(commandDir: string): Observable<
} catch {
mod = (await import(`file:///` + absPath)).default;
}

try {
mod = new (mod as unknown as new (...args: unknown[]) => T)();
} catch {}

if (mod !== undefined) {
return Ok({ mod, absPath });
} else return Err(SernError.UndefinedModule);
Expand Down