Skip to content
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

[BUG] Array上报的消息格式不正确 #112

Closed
frankli0324 opened this issue Nov 23, 2020 · 3 comments
Closed

[BUG] Array上报的消息格式不正确 #112

frankli0324 opened this issue Nov 23, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@frankli0324
Copy link

frankli0324 commented Nov 23, 2020

onebot规范中消息段的格式为{"type":"xml", "data":{"data":"xml data"}},而收到的格式为{"ClassType": "Xml", "xml":"xml data"}

如:

{
  "ClassType": "Xml",
  "xml": "<?xml version='1.0' encoding='UTF-8' standalone='yes' ?><msg serviceID=\"35\" templateID=\"1\" action=\"viewMultiMsg\" brief=\"[聊天记录]\" m_resid=\"[手动删除]\" m_fileName=\"[手动删除]\" tSum=\"3\" sourceMsgId=\"0\" url=\"\" flag=\"3\" adverSign=\"0\" multiMsgFlag=\"0\"><item layout=\"1\" advertiser_id=\"0\" aid=\"0\"><title size=\"34\" maxLines=\"2\" lineSpace=\"12\">Cyan和Frank™的聊天记录</title><title size=\"26\" color=\"#777777\" maxLines=\"2\" lineSpace=\"12\">Cyan:  ddl总览\n[11/24/2020](symcpt_3)对称密码分析\n[11/…</title><title size=\"26\" color=\"#777777\" maxLines=\"2\" lineSpace=\"12\">Cyan:  Loaded Module: Repeater</title><title size=\"26\" color=\"#777777\" maxLines=\"2\" lineSpace=\"12\">Frank™:  a</title><hr hidden=\"false\" style=\"0\" /><summary size=\"26\" color=\"#777777\">查看3条转发消息</summary></item><source name=\"聊天记录\" icon=\"\" action=\"\" appid=\"-1\" /></msg>"
}

maybe related

object CQJson {
@OptIn(InternalSerializationApi::class)
val json = Json {
encodeDefaults = true
classDiscriminator = "ClassType"

复现

向bot批量转发聊天记录即可

版本

onebot-kotlin- 0.3.0

@yyuueexxiinngg yyuueexxiinngg added the bug Something isn't working label Nov 23, 2020
@yyuueexxiinngg yyuueexxiinngg changed the title [BUG] 上报批量转发的消息格式不正确 [BUG] Array上报的消息格式不正确 Nov 23, 2020
@yyuueexxiinngg
Copy link
Owner

符合OneBot标准的合并转发在此Issue跟踪
#111

@frankli0324
Copy link
Author

frankli0324 commented Nov 23, 2020

0.3.2xml array格式仍然不正确
现在收到的格式为

{
	"type": "xml",
	"ClassType": "Xml",
	"data": "<xml>" // 此处应为 "data": { "data": "<xml>" }
}

@yyuueexxiinngg
Copy link
Owner

已在 a931571 中修复, 将在0.3.3中Release, 现可通过Action下载最新Commit的Jar包

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants