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?]: 消息事件收到的 File 消息段的格式与文档不符 #708

Closed
4 tasks done
RF-Tar-Railt opened this issue Dec 14, 2024 · 1 comment · Fixed by #709
Closed
4 tasks done

[Bug?]: 消息事件收到的 File 消息段的格式与文档不符 #708

RF-Tar-Railt opened this issue Dec 14, 2024 · 1 comment · Fixed by #709
Labels
bug? Maybe it's a bug

Comments

@RF-Tar-Railt
Copy link

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

  • 我已经仔细阅读上述内容
  • 我已经使用 最新构建 测试过,问题依旧存在。
  • 我已经在 Issue Tracker 中找过我要提出的问题,没有找到相同问题的ISSUE。
  • 我已知晓并同意,此处仅用于汇报程序中存在的问题。若这个 Issue 是关于其他非程序本身问题,则我的 Issue 可能会被无条件自动关闭或/并锁定。(其它疑问请考虑加入TG群询问或在discussions中提问)

Lagrange项目

OneBot

所使用/依赖的Lagrange项目对应的commit

0d27bab

运行环境

MacOS

运行架构

arm64

连接方式

正向 WebSocket

重现步骤

收到携带 File 消息段的消息事件

期望的结果是什么?

image
消息段内容与文档相符

实际的结果是什么?

6653be5abcb8b977531760f1658405ec

file_name => filename

file_id => id

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

No response

Trace 级别日志记录(可选)

No response

补充说明(可选)

No response

@RF-Tar-Railt RF-Tar-Railt added the bug? Maybe it's a bug label Dec 14, 2024
@ishkong
Copy link
Collaborator

ishkong commented Dec 15, 2024

该文档已经废弃,且OneBot11里未明确定义,同时上述file的部分信息tx并不会推送,所以为了保证准确性,请使用对应的api获取

关于字段名,会修改

关于该消息段在lagrange里的定义,请参考如下:

位于消息里(指推送和get_msg获取)的FileSegment将暂时只会包含一下信息:

file_name: 文件名字,用于使用获取文件下载链接后,确定文件名
file_id: 文件id,刷新链接必要的内容
file_hash: 刷新私聊文件下载链接可能需要用到的参数,从目前情况来看,不用该值也能获取到,保存备用,群聊文件该值为空
url:收到有文件上传通知时可用的下载链接,非长期有效链接,不确定失效时间

备注:若群文件上传,没有将文件上传到根目录下,该消息段不会有任何提示。因为若发生文件位置移动,tx也不会有通知,所以群文件还需要自行确定文件所处位置

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug? Maybe it's a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants