-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
问题描述
通过mirai框架的onlineAnnouncement.members()方法 只能获取50个人 不能获取全部看过公告的人 而且返回的list集合长度只有50
复现
/---------------------检查看过公告成员----------------------/
while (LOOKMAP.size() >0) {
Thread.sleep(5000);
MiraiGroup group = event.getGroup();
MiraiAnnouncements announcements = group.getAnnouncements();
Announcements originalAnnouncements = announcements.getOriginalAnnouncements();
List onlineAnnouncements = originalAnnouncements.toList();
// 获取群里面的第一个公告
OnlineAnnouncement onlineAnnouncement = onlineAnnouncements.get(0);
// 获取群里面都有谁看了公告
List members = onlineAnnouncement.members(false);
for (int i = 0; i < members.size(); i++) {
// 获取到刚才进群的成员
String key = members.get(i).toString().substring(13, members.get(i).toString().length() - 1);
if (LOOKMAP.get(key)==null) {
continue;
}
// 获取这个新成员进行解除禁言
MiraiMember member1 = group.getMember(LOOKMAP.get(key));
member1.unmuteBlocking();
At at1 = new At(LOOKMAP.get(key));
Messages elements1 = Messages.toMessages(at1, Text.of("\n检测到你已经阅读新人群公告自动解除禁言"));
event.getGroup().sendBlocking(elements1);
LOOKMAP.remove(key);
}
}
}
mirai-core 版本
2.14.0
bot-protocol
ANDROID_WATCH
其他组件版本
No response
系统日志
No response
网络日志
No response
补充信息
No response