Closed ForliyScarlet closed 1 year ago
增加新的核心模块消息元素类型 QGEmbed 来提供对 embed 类型消息的支持。
QGEmbed
val channel = ... // 构建消息并发送 channel.send(buildQGEmbed { title = "标题" prompt = "弹窗消息内容" addField("当前等级:黄金") addField("之前等级:白银") })
Java:
Channel channel = ...; // 构建 Embed 对象 final EmbedBuilder builder = new EmbedBuilder(); builder.setTitle("标题"); builder.setPrompt("弹窗消息内容"); builder.addField("当前等级:黄金"); builder.addField("之前等级:白银"); // 构建 QGEmbed 对象 final QGEmbed qgEmbed = QGEmbed.byEmbed(builder.build()); channel.sendBlocking(qgEmbed);
QGEmbed 占有一条独立的消息位,如果与其他消息合并发送(例如文本消息:"".toText() + buildQGEmbed { ... } )则消息会被切割为多条。
"".toText() + buildQGEmbed { ... }
Warning embed 消息似乎不能同时使用消息引用。因此需要发送 embed 消息的时候请尽可能使用 send 相关的API而不是 reply。 当然,也许这个问题会在后续改善,或者如果你有好的方案也欢迎提供思路或协助我们
embed
send
reply
close https://github.com/simple-robot/simbot-component-qq-guild/issues/107
It seems all right 👌
No new problems were found according to the checks applied
💡 Qodana analysis was run in the pull request mode: only the changed files were checked ☁️ View the detailed Qodana report
增加新的核心模块消息元素类型
QGEmbed
来提供对 embed 类型消息的支持。Java:
QGEmbed
占有一条独立的消息位,如果与其他消息合并发送(例如文本消息:"".toText() + buildQGEmbed { ... }
)则消息会被切割为多条。close https://github.com/simple-robot/simbot-component-qq-guild/issues/107