mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-03-01 08:10:25 +00:00
refactor: packet x1
This commit is contained in:
27
src/core/packet/clientSession.ts
Normal file
27
src/core/packet/clientSession.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { PacketContext } from "@/core/packet/context/packetContext";
|
||||
import { NapCatCore } from "@/core";
|
||||
|
||||
export class PacketClientSession {
|
||||
private readonly context: PacketContext;
|
||||
|
||||
constructor(core: NapCatCore) {
|
||||
this.context = new PacketContext(core);
|
||||
}
|
||||
|
||||
init(pid: number, recv: string, send: string): Promise<void> {
|
||||
return this.context.client.init(pid, recv, send);
|
||||
}
|
||||
|
||||
get available() {
|
||||
return this.context.client.available;
|
||||
}
|
||||
|
||||
get operation() {
|
||||
return this.context.operation;
|
||||
}
|
||||
|
||||
// TODO: global message element adapter (?
|
||||
get msgConverter() {
|
||||
return this.context.msgConverter;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user