diff --git a/src/onebot11/action/group/GetGroupMemberList.ts b/src/onebot11/action/group/GetGroupMemberList.ts index 3a646bab..9a2e500b 100644 --- a/src/onebot11/action/group/GetGroupMemberList.ts +++ b/src/onebot11/action/group/GetGroupMemberList.ts @@ -7,6 +7,8 @@ import { napCatCore, NTQQGroupApi, NTQQUserApi, SignMiniApp } from '@/core'; import { WebApi } from '@/core/apis/webapi'; import { logDebug } from '@/common/utils/log'; import { FromSchema, JSONSchema } from 'json-schema-to-ts'; +import { getLastSentTimeAndJoinTime }from "./LastSendAndJoinRemberLRU" + const SchemaData = { type: 'object', properties: { @@ -56,6 +58,21 @@ class GetGroupMemberList extends BaseAction { } // 还原Map到Array const RetGroupMember: OB11GroupMember[] = Array.from(MemberMap.values()); + + // 无管理员权限通过本地记录获取发言时间 + const haveAdmin = RetGroupMember[0].last_sent_time !== 0; + if (!haveAdmin) { + logDebug('没有管理员权限,使用本地记录'); + const _sendAndJoinRember = await getLastSentTimeAndJoinTime(parseInt(group.groupCode)); + _sendAndJoinRember.forEach((rember) => { + const member = RetGroupMember.find(member=>member.user_id == rember.user_id); + if(member){ + member.last_sent_time = rember.last_sent_time; + member.join_time = rember.join_time; + } + }) + } + return RetGroupMember; } }