mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
chore: onRecv
This commit is contained in:
@@ -3,6 +3,8 @@ import path from "node:path";
|
|||||||
import fs from "node:fs";
|
import fs from "node:fs";
|
||||||
import { InstanceContext } from "./wrapper";
|
import { InstanceContext } from "./wrapper";
|
||||||
import { NTEventChannel } from "@/common/framework/event";
|
import { NTEventChannel } from "@/common/framework/event";
|
||||||
|
import { proxiedListenerOf } from "@/common/utils/proxy-handler";
|
||||||
|
import { MsgListener } from "./listeners";
|
||||||
|
|
||||||
export enum NapCatCoreWorkingEnv {
|
export enum NapCatCoreWorkingEnv {
|
||||||
Unknown = 0,
|
Unknown = 0,
|
||||||
@@ -27,10 +29,17 @@ export class NapCatCore {
|
|||||||
constructor(context: InstanceContext) {
|
constructor(context: InstanceContext) {
|
||||||
this.context = context;
|
this.context = context;
|
||||||
this.eventChannel = new NTEventChannel(context.wrapper, context.session);
|
this.eventChannel = new NTEventChannel(context.wrapper, context.session);
|
||||||
|
this.initNapCatCoreListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Renamed from 'InitDataListener'
|
// Renamed from 'InitDataListener'
|
||||||
initNapCatCoreListeners() {
|
initNapCatCoreListeners() {
|
||||||
|
let msg = new MsgListener();
|
||||||
|
msg.onRecvMsg = (msg) => {
|
||||||
|
console.log("RecvMsg", msg);
|
||||||
|
}
|
||||||
|
this.context.session.getMsgService().addKernelMsgListener(
|
||||||
|
new this.context.wrapper.NodeIKernelMsgListener(proxiedListenerOf(msg, this.context.logger))
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user