From a70585e85436345d2386ccbce42b9cc0680821ea 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: Sat, 30 Nov 2024 12:08:58 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A4=84=E7=90=86=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/services/NodeIKernelGroupService.ts | 2 +- src/onebot/action/group/SetGroupName.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/services/NodeIKernelGroupService.ts b/src/core/services/NodeIKernelGroupService.ts index fd9b2c70..61f3179a 100644 --- a/src/core/services/NodeIKernelGroupService.ts +++ b/src/core/services/NodeIKernelGroupService.ts @@ -163,7 +163,7 @@ export interface NodeIKernelGroupService { getGroupPortrait(): void; - modifyGroupName(groupCode: string, groupName: string, arg: false): void; + modifyGroupName(groupCode: string, groupName: string, isNormalMember: boolean): Promise; modifyGroupRemark(groupCode: string, remark: string): void; diff --git a/src/onebot/action/group/SetGroupName.ts b/src/onebot/action/group/SetGroupName.ts index 816317d9..719649c5 100644 --- a/src/onebot/action/group/SetGroupName.ts +++ b/src/onebot/action/group/SetGroupName.ts @@ -17,7 +17,10 @@ export default class SetGroupName extends OneBotAction { payloadSchema = SchemaData; async _handle(payload: Payload): Promise { - await this.core.apis.GroupApi.setGroupName(payload.group_id.toString(), payload.group_name); + let ret = await this.core.apis.GroupApi.setGroupName(payload.group_id.toString(), payload.group_name); + if (ret.result !== 0) { + throw new Error(`设置群名称失败 ErrCode: ${ret.result} ErrMsg: ${ret.errMsg}`); + } return null; } }