From d40230879cffe8cf01fcb85b70dbde48cb456f6b 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: Tue, 4 Jun 2024 12:20:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=8E=84=E5=AD=A6=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/changelogs/CHANGELOG.v1.5.1.md | 2 +- src/common/utils/EventTask.ts | 10 +++++----- src/onebot11/action/group/GetGroupSystemMsg.ts | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/changelogs/CHANGELOG.v1.5.1.md b/docs/changelogs/CHANGELOG.v1.5.1.md index c74d2117..a0cfbc95 100644 --- a/docs/changelogs/CHANGELOG.v1.5.1.md +++ b/docs/changelogs/CHANGELOG.v1.5.1.md @@ -4,7 +4,7 @@ QQ Version: Windows 9.9.10-24108 / Linux 3.2.7-23361 ## 修复与优化 * 支持 新Api: set_self_profile 可设置个性签名 - +* 修复 Api: get_group_system_msg ## 新增与调整 diff --git a/src/common/utils/EventTask.ts b/src/common/utils/EventTask.ts index cf33e4ba..2bdcc284 100644 --- a/src/common/utils/EventTask.ts +++ b/src/common/utils/EventTask.ts @@ -112,14 +112,13 @@ export class NTEventWrapper { return new Promise<[EventRet: Awaited>, ...Parameters]>(async (resolve, reject) => { const id = randomUUID(); let complete = 0; - let retData: ArrayLike> | undefined = undefined; + let retData: Parameters | undefined = undefined; let retEvent: any = {}; const databack = () => { if (complete < waitTimes) { reject(new Error('NTEvent EventName:' + EventName + ' ListenerName:' + ListenerName + ' timeout')); } else { - - resolve([retEvent as Awaited>, ...(retData as Parameters)]); + resolve([retEvent as Awaited>, ...retData!]); } }; const Timeouter = setTimeout(databack, timeout); @@ -133,7 +132,7 @@ export class NTEventWrapper { func: (...args: any[]) => { complete++; //console.log('func', ...args); - retData = args as ArrayLike>; + retData = args as Parameters; if (complete >= waitTimes) { clearTimeout(Timeouter); databack(); @@ -149,7 +148,8 @@ export class NTEventWrapper { this.EventTask.get(ListenerMainName)?.get(ListenerSubName)?.set(id, eventCallbak); this.CreatListenerFunction(ListenerMainName); const EventFunc = this.CreatEventFunction(EventName); - retEvent = await EventFunc!(...args); + //console.log("测试打点", args); + retEvent = await EventFunc!(...(args as any[])); }); } } diff --git a/src/onebot11/action/group/GetGroupSystemMsg.ts b/src/onebot11/action/group/GetGroupSystemMsg.ts index 7dba46eb..a86e9553 100644 --- a/src/onebot11/action/group/GetGroupSystemMsg.ts +++ b/src/onebot11/action/group/GetGroupSystemMsg.ts @@ -8,7 +8,7 @@ import { uid2UinMap } from '@/core/data'; const SchemaData = { type: 'object', properties: { - group_id: { type: [ 'number' , 'string' ] } + group_id: { type: ['number', 'string'] } }, } as const satisfies JSONSchema;