We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
FileMessage
在Onebot中没有定义文件的消息段,但是定义了group_upload事件,应该对应Mirai的FileMessage;但是因为历史缘故,Mirai的FileMessage实现为:public fun FileMessage(id: String, internalId: Int, name: String, size: Long),name 与 size 只供本地使用, 发送消息时只会使用 id 和 internalId.
public fun FileMessage(id: String, internalId: Int, name: String, size: Long)
而Onebot的group_upload为
time
self_id
post_type
notice
notice_type
group_upload
group_id
user_id
file
其中 file 字段的内容如下:
id
name
size
busid
差距挺大,感觉无从下手
Onebot(Lagrange)日志为:
2024-11-25 17:25:38 D/Onebot: [Recv] <-- {"message_type":"group","sub_type":"normal","message_id":MSG_ID,"group_id":GROUP_ID,"user_id":USER_ID,"anonymous":null,"message":[],"raw_message":"","font":0,"sender":{"user_id":USER_ID,"nickname":"NICKNAME","card":"username","sex":"unknown","age":0,"area":"","level":"100","role":"owner","title":""},"time":1732526738,"self_id":BOT_ID,"post_type":"message"} 2024-11-25 17:25:38 D/Onebot: [Recv] <-- {"group_id":GROUP_ID,"user_id":USER_ID,"file":{"id":"/81xxxxxd-axx7-4xx0-8xx8-axxxxxxxxxxa","name":"xxx.exe","size":700000,"busid":0,"url":"FILE_URL"},"notice_type":"group_upload","time":1732526738,"self_id":BOT_ID,"post_type":"notice"}
Onebot(Lagrange)会传递一条空的消息提供message_id,再用group_upload提供文件详情
如果要作为FileMessage的话还需要将这两条消息组合起来才能正常进行回复、撤回等操作
感觉会很麻烦,先留个issue在这儿
The text was updated successfully, but these errors were encountered:
写 go cqhttp 的文件支持的时候见过 busid,把它当成这个文件的id来使用就好了
对于这个 file 字段,写过类似的转换
Sorry, something went wrong.
No branches or pull requests
在Onebot中没有定义文件的消息段,但是定义了group_upload事件,应该对应Mirai的FileMessage;但是因为历史缘故,Mirai的FileMessage实现为:
public fun FileMessage(id: String, internalId: Int, name: String, size: Long)
,name 与 size 只供本地使用, 发送消息时只会使用 id 和 internalId.而Onebot的group_upload为
time
self_id
post_type
notice
notice_type
group_upload
group_id
user_id
file
其中
file
字段的内容如下:id
name
size
busid
差距挺大,感觉无从下手
Onebot(Lagrange)日志为:
Onebot(Lagrange)会传递一条空的消息提供message_id,再用group_upload提供文件详情
如果要作为FileMessage的话还需要将这两条消息组合起来才能正常进行回复、撤回等操作
感觉会很麻烦,先留个issue在这儿
The text was updated successfully, but these errors were encountered: