mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
fix: handleQuickOperation
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user