fix & refactor: pass actions through constructor

This commit is contained in:
Wesley F. Young
2024-08-12 12:08:53 +08:00
parent 28930fdad4
commit b99fb247ac
7 changed files with 77 additions and 128 deletions

View File

@@ -162,7 +162,7 @@ export function createActionMap(onebotContext: NapCatOneBot11Adapter, coreContex
new FetchCustomFace(onebotContext, coreContext),
new GoCQHTTPUploadPrivateFile(onebotContext, coreContext),
];
const actionMap = new Map<string, BaseAction<any, any>>();
const actionMap = new Map();
for (const action of actionHandlers) {
actionMap.set(action.actionName, action);
actionMap.set(action.actionName + '_async', action);