From 607e367bb10dd6788efa25659062df6b9cfd9771 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: Fri, 9 May 2025 13:17:47 +0800 Subject: [PATCH] fix --- src/core/services/NodeIKernelGroupService.ts | 2 +- src/onebot/action/group/SetGroupWholeBan.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/services/NodeIKernelGroupService.ts b/src/core/services/NodeIKernelGroupService.ts index babcad73..d072b394 100644 --- a/src/core/services/NodeIKernelGroupService.ts +++ b/src/core/services/NodeIKernelGroupService.ts @@ -249,7 +249,7 @@ export interface NodeIKernelGroupService { reqToJoinGroup(groupCode: string, arg: unknown): void; - setGroupShutUp(groupCode: string, shutUp: boolean): void; + setGroupShutUp(groupCode: string, shutUp: boolean): Promise; getGroupShutUpMemberList(groupCode: string): Promise; diff --git a/src/onebot/action/group/SetGroupWholeBan.ts b/src/onebot/action/group/SetGroupWholeBan.ts index a4c84c44..3ff633ca 100644 --- a/src/onebot/action/group/SetGroupWholeBan.ts +++ b/src/onebot/action/group/SetGroupWholeBan.ts @@ -15,7 +15,10 @@ export default class SetGroupWholeBan extends OneBotAction { async _handle(payload: Payload): Promise { const enable = payload.enable?.toString() !== 'false'; - await this.core.apis.GroupApi.banGroup(payload.group_id.toString(), enable); + let res = await this.core.apis.GroupApi.banGroup(payload.group_id.toString(), enable); + if (res.result !== 0) { + throw new Error(`SetGroupWholeBan failed: ${res.errMsg} ${res.result}`); + } return null; } }