From a0bf2b3d3dbc0737b5d77bfd24f1fa88cdf68c68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=8B=E7=93=9C=E4=B8=80=E5=8D=81=E9=9B=AA?= Date: Thu, 8 Aug 2024 21:31:00 +0800 Subject: [PATCH] chore: remove sleep --- src/core/core.ts | 2 +- src/liteloader/napcat.ts | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/core/core.ts b/src/core/core.ts index 1fbf1316..28e49363 100644 --- a/src/core/core.ts +++ b/src/core/core.ts @@ -39,7 +39,7 @@ export class NapCatCore { msg.onRecvMsg = (msg) => { console.log("RecvMsg", msg); } - await sleep(2500); + //await sleep(2500); this.context.session.getMsgService().addKernelMsgListener( new this.context.wrapper.NodeIKernelMsgListener(proxiedListenerOf(msg, this.context.logger)) ); diff --git a/src/liteloader/napcat.ts b/src/liteloader/napcat.ts index 47dae4fc..e2e76368 100644 --- a/src/liteloader/napcat.ts +++ b/src/liteloader/napcat.ts @@ -10,6 +10,7 @@ import { LoginListener } from "@/core/listeners"; import { NodeIKernelLoginService } from "@/core/services"; import { WrapperNodeApi, NodeIQQNTWrapperSession } from "@/core/wrapper/wrapper"; import { NapCatOneBot11Adapter } from "@/onebot/main"; +import { sleep } from "@/common/utils/helper"; //LiteLoader ES入口文件 export async function NCoreInitLiteLoader(session: NodeIQQNTWrapperSession, loginService: NodeIKernelLoginService) { @@ -31,7 +32,8 @@ export async function NCoreInitLiteLoader(session: NodeIQQNTWrapperSession, logi loginService.addKernelLoginListener(new wrapper.NodeIKernelLoginListener( proxiedListenerOf(loginListener, logger))); }); - + + await sleep(2500); // 初始化 NapCatLiteLoader let loaderObject = new NapCatLiteLoader(wrapper, session, logger, loginService, selfInfo, basicInfoWrapper); @@ -44,7 +46,7 @@ export async function NCoreInitLiteLoader(session: NodeIQQNTWrapperSession, logi export class NapCatLiteLoader { public core: NapCatCore; context: InstanceContext; - + constructor( wrapper: WrapperNodeApi, session: NodeIQQNTWrapperSession, @@ -53,7 +55,7 @@ export class NapCatLiteLoader { selfInfo: SelfInfo, basicInfoWrapper: QQBasicInfoWrapper, ) { - this.context = { + this.context = { workingEnv: NapCatCoreWorkingEnv.LiteLoader, wrapper, session,