chore: Onebot context
This commit is contained in:
1 parent
0ef6d8eee4
commit
8332d6ab41
6 files changed
+48
-37
No files matched your search
@@ -4,6 +4,7 @@ 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 {
|
||||
logger: LogWrapper;
|
||||
@@ -12,7 +13,8 @@ export class OB11ActiveHttpAdapter implements IOB11NetworkAdapter {
|
||||
constructor(
|
||||
public url: string,
|
||||
public secret: string | undefined,
|
||||
public coreContext: NapCatCore
|
||||
public coreContext: NapCatCore,
|
||||
public obContext: NapCatOneBot11Adapter
|
||||
) {
|
||||
this.logger = coreContext.context.logger;
|
||||
}
|
||||
@@ -46,7 +48,7 @@ export class OB11ActiveHttpAdapter implements IOB11NetworkAdapter {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
handleQuickOperation(this.coreContext, event as QuickActionEvent, resJson).then().catch(this.logger.logError);
|
||||
handleQuickOperation(this.coreContext, this.obContext, event as QuickActionEvent, resJson).then().catch(this.logger.logError);
|
||||
} catch (e: any) {
|
||||
this.logger.logError('新消息事件HTTP上报返回快速操作失败', e);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user