-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
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
使用 Announcements.get(fid) 出现 kotlinx.serialization.MissingFieldException: Field 'msg' #2509
Comments
确认fid正确吗,是获取这个公告就必然出现,还是只是有时候会? |
以示例代码中的表现,我是直接通过获取到的公告列表循环并获取fid的,没有手写的情况,应该不会出错
我将测试代码改成如下: val announcements = bot.getGroup(703454734)!!.announcements
announcements.asFlow().collect { announcement ->
try {
logger.info("success: {}", announcements.get(announcement.fid))
} catch (e: Throwable) {
logger.error("failure. announcement: {}", announcement)
logger.error("e: {}", e.toString())
}
} 得到的日志如下:
测试的5条公告全部获取失败,看起来像是必然情况 换了一个258条公告的群测试,同样全部失败。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
问题描述
当通过
Announcements.get(fid)
获取指定公告的时候出现反序列化异常复现
mirai-core 版本
2.14.0
bot-protocol
ANDROID_PHONE
其他组件版本
No response
系统日志
网络日志
No response
补充信息
测试用群公告如图:
The text was updated successfully, but these errors were encountered: