chore: reformat code style

This commit is contained in:
Seijo Cecilia
2024-08-26 14:52:05 +08:00
parent 3ec0edfc60
commit 7671174a96
60 changed files with 295 additions and 237 deletions

View File

@@ -1,4 +1,3 @@
import { WebApiGroupNoticeFeed } from '@/core';
import BaseAction from '../BaseAction';
import { ActionName } from '../types';
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
@@ -10,7 +9,7 @@ const SchemaData = {
group_id: { type: ['number', 'string'] },
notice_id: { type: 'string' },
},
required: ['group_id','notice_id'],
required: ['group_id', 'notice_id'],
} as const satisfies JSONSchema;
type Payload = FromSchema<typeof SchemaData>;

View File

@@ -26,14 +26,14 @@ class GetGroupMemberInfo extends BaseAction<Payload, OB11GroupMember> {
const NTQQGroupApi = this.core.apis.GroupApi;
const isNocache = typeof payload.no_cache === 'string' ? payload.no_cache === 'true' : !!payload.no_cache;
const uid = await NTQQUserApi.getUidByUinV2(payload.user_id.toString());
if (!uid) throw new Error (`Uin2Uid Error ${payload.user_id}不存在`);
if (!uid) throw new Error(`Uin2Uid Error ${payload.user_id}不存在`);
const [member, info] = await Promise.allSettled([
NTQQGroupApi.getGroupMemberV2(payload.group_id.toString(), uid, isNocache),
NTQQUserApi.getUserDetailInfo(uid),
]);
if (member.status !== 'fulfilled') throw new Error (`群(${payload.group_id})成员${payload.user_id}不存在 ${member.reason}`);
if (member.status !== 'fulfilled') throw new Error(`群(${payload.group_id})成员${payload.user_id}不存在 ${member.reason}`);
if (info.status === 'fulfilled') {
this.core.context.logger.logDebug("群成员详细信息结果", info.value);
this.core.context.logger.logDebug('群成员详细信息结果', info.value);
Object.assign(member, info.value);
} else {
this.core.context.logger.logDebug(`获取群成员详细信息失败, 只能返回基础信息 ${info.reason}`);

View File

@@ -63,7 +63,7 @@ class GetGroupMemberList extends BaseAction<Payload, OB11GroupMember[]> {
}
}
}
_groupMembers = Array.from(MemberMap.values());
return _groupMembers;
}