simple-robot / simpler-robot

Simple Robot,一个bot风格的Kotlin多平台事件调度框架,异步高效、Java友好!/ A Bot-style Kotlin Multiplatform event scheduling framework, asynchronous and high-performance, java-friendly! 🐱😼😻😸
https://simbot.forte.love
GNU Lesser General Public License v3.0
520 stars 43 forks source link

使用MessageSerializationUtil.toJsonString序列化图片消息失败:java.lang.IllegalStateException: Primitives cannot be serialized polymorphically with 'type' parameter. You can use 'JsonBuilder.useArrayPolymorphism' instead #391

Closed enchantedyou closed 2 years ago

enchantedyou commented 2 years ago

版本号

v3.0.0-beta-RC-SNAPSHOT

疑问描述

我想将消息序列化以存入数据库,但发现无法序列化图片/表情包消息,异常提示的内容无法理解,阅读文档 https://simple-robot-library.github.io/simbot3-main-apiDoc/v3.0.0.preview.20.0/simbot-apis/simbot-api/love.forte.simbot.message/-message-serialization-util/index.html 未找到相关说明,能否进行一下答疑,谢谢

enchantedyou commented 2 years ago

这是我的伪代码: GroupMessageEvent e; MessageSerializationUtil.toJsonString(e.getMessageContent().getMessages());

ForteScarlet commented 2 years ago

由mirai组件导致的问题,请追踪 https://github.com/simple-robot/simbot-component-mirai/issues/53

当前issue将会关闭。