We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
通过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); } }
}
2.14.0
ANDROID_WATCH
No response
The text was updated successfully, but these errors were encountered:
#2530
Sorry, something went wrong.
你好 我看到不是特别懂 我想问一下 这个如果是bug什么时候可以修复呀
这是设计失误,因为当时没有测试大群的情况,没发现他最多返回 50 条记录,需要分段获取
分段获得 怎么获取呀 大佬 可以举个例子嘛
你等更新就行了
Successfully merging a pull request may close this issue.
问题描述
通过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
The text was updated successfully, but these errors were encountered: