fix: handleQuickOperation

This commit is contained in:
bietiaop
2024-12-17 00:27:56 +08:00
parent 35de00c4af
commit 553885d025
2 changed files with 7 additions and 5 deletions

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);
}
}

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);
}