fix: Error

This commit is contained in:
手瓜一十雪
2024-10-29 10:52:50 +08:00
parent c3d4698af3
commit 61ddf38892

@@ -12,6 +12,7 @@ import {
import { isNumeric, solveAsyncProblem } from '@/common/helper'; import { isNumeric, solveAsyncProblem } from '@/common/helper';
import { LimitedHashTable } from '@/common/message-unique'; import { LimitedHashTable } from '@/common/message-unique';
import { NTEventWrapper } from '@/common/event'; import { NTEventWrapper } from '@/common/event';
import { c } from 'vite/dist/node/types.d-aGj9QkWt';
export class NTQQGroupApi { export class NTQQGroupApi {
context: InstanceContext; context: InstanceContext;
@@ -337,19 +338,20 @@ export class NTQQGroupApi {
} }
this.context.session.getGroupService().destroyMemberListScene(sceneId); this.context.session.getGroupService().destroyMemberListScene(sceneId);
return { return {
infos: resMode2?.infos || result.result.infos, infos: new Map([...(resMode2?.infos ?? []), ...result.result.infos]),
finish: result.result.finish, finish: result.result.finish,
hasNext: resMode2?.hasNext, hasNext: resMode2?.hasNext,
}; };
} }
async getGroupMembersV2(groupQQ: string, num = 3000): Promise<Map<string, GroupMember>> { async getGroupMembersV2(groupQQ: string, num = 3000): Promise<Map<string, GroupMember>> {
let res = await this.tryGetGroupMembersV2(true, groupQQ); console.log("-start-", groupQQ);
let res = await this.tryGetGroupMembersV2(true, groupQQ, 3000);
if (res.hasNext || !res.finish || res.infos.size === 0) { if (res.hasNext || !res.finish || res.infos.size === 0) {
res = await this.tryGetGroupMembersV2(false, groupQQ, num); res = await this.tryGetGroupMembersV2(false, groupQQ, 3000);
} }
if ((res.infos.size === 0 || res.infos.size === 30) && !res.finish) { if (res.infos.size === 0 && res.finish) {
res = await this.tryGetGroupMembersV2(true, groupQQ, num); res = await this.tryGetGroupMembersV2(true, groupQQ, 3000);
} }
return res.infos; return res.infos;
} }