refactor: move calls & clean code

This commit is contained in:
Seijo Cecilia
2024-08-26 14:21:31 +08:00
parent 793071cdf1
commit e3e5a1bcdb
9 changed files with 42 additions and 118 deletions

View File

@@ -3,7 +3,6 @@ import { createHmac } from 'crypto';
import { LogWrapper } from '@/common/utils/log';
import { QuickAction, QuickActionEvent } from '../types';
import { NapCatCore } from '@/core';
import { handleQuickOperation } from '../helper/quick';
import { NapCatOneBot11Adapter } from '..';
export class OB11ActiveHttpAdapter implements IOB11NetworkAdapter {
@@ -48,7 +47,9 @@ export class OB11ActiveHttpAdapter implements IOB11NetworkAdapter {
return;
}
try {
handleQuickOperation(this.core, this.obContext, event as QuickActionEvent, resJson).then().catch(this.logger.logError);
this.obContext.apis.QuickActionApi
.handleQuickOperation(event as QuickActionEvent, resJson)
.catch(this.logger.logError);
} catch (e: any) {
this.logger.logError('[OneBot] [Http Client] 新消息事件HTTP上报返回快速操作失败', e);
}