feat: 处理失败的情况
This commit is contained in:
1 parent
040d0a8635
commit
a70585e854
2 files changed
+5
-2
No files matched your search
@@ -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<GeneralCallResult>;
|
||||
|
||||
modifyGroupRemark(groupCode: string, remark: string): void;
|
||||
|
||||
|
||||
@@ -17,7 +17,10 @@ export default class SetGroupName extends OneBotAction<Payload, null> {
|
||||
payloadSchema = SchemaData;
|
||||
|
||||
async _handle(payload: Payload): Promise<null> {
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user