feat(handler) more plugin work, refactoring rxjs pipes

This commit is contained in:
Jacob Nguyen
2022-04-13 01:34:25 -05:00
parent de7ddc390f
commit f213e88a5d
9 changed files with 139 additions and 133 deletions

View File

@@ -1,16 +1,15 @@
import { readdirSync, statSync } from 'fs';
import { join } from 'path';
import type { Module } from '../structures/modules/commands/module';
import { SernError } from '../structures/errors';
import type { PluggedModule } from '../structures/modules/module';
//We can look into lazily loading modules once everything is set
export const ContextMenuUser = new Map<string, Module>();
export const ContextMenuMsg = new Map<string, Module>();
export const Commands = new Map<string, Module>();
export const Alias = new Map<string, Module>();
export const Buttons = new Map<string, Module>();
export const SelectMenus = new Map<string, Module>();
export const ContextMenuUser = new Map<string, PluggedModule>();
export const ContextMenuMsg = new Map<string, PluggedModule>();
export const Commands = new Map<string, PluggedModule>();
export const Alias = new Map<string, PluggedModule>();
export const Buttons = new Map<string, PluggedModule>();
export const SelectMenus = new Map<string, PluggedModule>();
// Courtesy @Townsy45
@@ -40,8 +39,7 @@ export async function buildData(commandDir: string ): Promise<
{
plugged: PluggedModule;
absPath: string;
}[]
> {
}[]> {
return Promise.all(
getCommands(commandDir).map( async (absPath) => {
const plugged = <PluggedModule> (await import(absPath)).module;