mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-03-01 16:20:25 +00:00
refactor: 项目结构
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { OB11Group } from '@/onebot';
|
||||
import { OB11Entities } from '@/onebot/entities';
|
||||
import { OB11Construct } from '@/onebot/helper/data';
|
||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
@@ -31,7 +31,7 @@ class GetGroupInfo extends OneBotAction<Payload, OB11Group> {
|
||||
max_member_count: data.searchGroupInfo.maxMemberNum,
|
||||
};
|
||||
}
|
||||
return OB11Entities.group(group);
|
||||
return OB11Construct.group(group);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { OB11Group } from '@/onebot';
|
||||
import { OB11Entities } from '@/onebot/entities';
|
||||
import { OB11Construct } from '@/onebot/helper/data';
|
||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
@@ -18,7 +18,7 @@ class GetGroupList extends OneBotAction<Payload, OB11Group[]> {
|
||||
payloadSchema = SchemaData;
|
||||
|
||||
async _handle(payload: Payload) {
|
||||
return OB11Entities.groups(
|
||||
return OB11Construct.groups(
|
||||
await this.core.apis.GroupApi.getGroups(
|
||||
typeof payload.no_cache === 'string' ? payload.no_cache === 'true' : !!payload.no_cache));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { OB11GroupMember } from '@/onebot';
|
||||
import { OB11Entities } from '@/onebot/entities';
|
||||
import { OB11Construct } from '@/onebot/helper/data';
|
||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
@@ -43,7 +43,7 @@ class GetGroupMemberInfo extends OneBotAction<Payload, OB11GroupMember> {
|
||||
} else {
|
||||
this.core.context.logger.logDebug(`获取群成员详细信息失败, 只能返回基础信息`);
|
||||
}
|
||||
return OB11Entities.groupMember(payload.group_id.toString(), member);
|
||||
return OB11Construct.groupMember(payload.group_id.toString(), member);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { OB11GroupMember } from '@/onebot';
|
||||
import { OB11Entities } from '@/onebot/entities';
|
||||
import { OB11Construct } from '@/onebot/helper/data';
|
||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
@@ -30,7 +30,7 @@ export class GetGroupMemberList extends OneBotAction<Payload, OB11GroupMember[]>
|
||||
groupMembers = memberCache.get(groupIdStr) ?? await this.core.apis.GroupApi.getGroupMembersV2(groupIdStr);
|
||||
}
|
||||
const memberPromises = Array.from(groupMembers.values()).map(item =>
|
||||
OB11Entities.groupMember(groupIdStr, item)
|
||||
OB11Construct.groupMember(groupIdStr, item)
|
||||
);
|
||||
const _groupMembers = await Promise.all(memberPromises);
|
||||
const MemberMap = new Map(_groupMembers.map(member => [member.user_id, member]));
|
||||
|
||||
Reference in New Issue
Block a user