Merge pull request #634 from bietiaop/main

fix: handleQuickOperation error
This commit is contained in:
手瓜一十雪 authored and GitHub committed 2024-12-17 00:29:16 +08:00
commit 6516bd805e
2 files changed
+7 -5

No files matched your search

+6 -1
View File
@@ -215,7 +215,12 @@ export class NapCatOneBot11Adapter {
await this.networkManager.closeSomeAdaterWhenOpen([existingAdapter]);
}
} else if (adapterConfig.enable) {
const newAdapter = new adapterClass(adapterConfig.name, adapterConfig, this.core, this.actions);
let newAdapter = new adapterClass( adapterConfig.name, adapterConfig, this.core, this.actions );
if (adapterClass === OB11ActiveHttpAdapter) {
newAdapter = new adapterClass(adapterConfig.name, adapterConfig, this.core, this, this.actions);
}
await this.networkManager.registerAdapterAndOpen(newAdapter);
}
}
+1 -4
View File
@@ -45,9 +45,6 @@ export class OB11ActiveHttpAdapter implements IOB11NetworkAdapter {
const data = await RequestUtil.HttpGetText(this.config.url, 'POST', msgStr, headers);
const resJson: QuickAction = data ? JSON.parse(data) : {};
if (!this.obContext.apis || !this.obContext.apis.QuickActionApi.handleQuickOperation) {
throw new Error('apis.QuickActionApi.handleQuickOperation 异常');
}
await this.obContext.apis.QuickActionApi.handleQuickOperation(event as QuickActionEvent, resJson);
}
@@ -78,4 +75,4 @@ export class OB11ActiveHttpAdapter implements IOB11NetworkAdapter {
return OB11NetworkReloadType.Normal;
}
}
}