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]: 含有CQ码为Reply的消息使用get_msg接口API返回的内容, Reply信息丢失 #2112

Closed
4 tasks done
YttriumC opened this issue Apr 26, 2023 · 0 comments
Closed
4 tasks done
Labels
bug? The issue author think this is a bug

Comments

@YttriumC
Copy link
Contributor

YttriumC commented Apr 26, 2023

请确保您已阅读以上注意事项,并勾选下方的确认框。

  • 我已经仔细阅读上述教程和 "提问前需知"
  • 我已经使用 dev分支版本 测试过,问题依旧存在。
  • 我已经在 Issue Tracker 中找过我要提出的问题,没有找到相同问题的ISSUE。
  • 我已知晓并同意,此处仅用于汇报程序中存在的问题。若这个 Issue 是关于其他非程序本身问题,则我的 Issue 可能会被无条件自动关闭或/并锁定。(这些问题应当在 Discussion 板块提出。)

go-cqhttp 版本

已测试1.0.0-rc5-1.0.1

运行环境

Windows (64)

运行架构

AMD64

连接方式

WebSocket (反向)

使用协议

6 | aPad

重现步骤

任意发送消息后回复, 获取回复消息的id, 使用get_msg接口传入id获取消息内容.

期望的结果是什么?

返回消息中应包含Reply信息.

实际的结果是什么?

返回内容中没有Reply. 与#1285类似, 但经测试reply字段直接消失,而不是变成空text.

经检查发现, 空text是内部处理的空格, go-cqhttp会将空格单独提出来放进一个text对象中, 故#1285和这个是同一问题.

简单的复现代码/链接(可选)

No response

日志记录(可选)

No response

补充说明(可选)

在源码中 coolq/cqcode.go:266 找到这样一句// ToMessageContent 将消息转换成 Content. 忽略 Reply, 不知道因为什么问题选择忽略Reply?

研究发现, 直接添加reply到数据库中会导致取消息时递归查询reply直到没有reply为止, 这大概就是去掉reply的原因.

@YttriumC YttriumC added the bug? The issue author think this is a bug label Apr 26, 2023
YttriumC pushed a commit to YttriumC/go-cqhttp that referenced this issue Apr 27, 2023
@fumiama fumiama closed this as completed in 14539ad Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug? The issue author think this is a bug
Projects
None yet
Development

No branches or pull requests

1 participant