Closed yixuan1912 closed 2 years ago
如果你使用 nonebot2 可以使用 MessageSegment.video
传入 pathlib.Path
来发送本地视频文件
参考:
pathlib 文档:https://docs.python.org/zh-cn/3/library/pathlib.html
MessageSegment.video
文档:https://onebot.adapters.nonebot.dev/docs/api/v11/message#MessageSegment-video
如果直接传入,需要添加 file://
,即 file:///data/bot/noneBot2/nonebot2/plugins/aaa.mp4
如果你使用 nonebot2 可以使用
MessageSegment.video
传入pathlib.Path
来发送本地视频文件参考: pathlib 文档:https://docs.python.org/zh-cn/3/library/pathlib.html
MessageSegment.video
文档:https://onebot.adapters.nonebot.dev/docs/api/v11/message#MessageSegment-video如果直接传入,需要添加
file://
,即file:///data/bot/noneBot2/nonebot2/plugins/aaa.mp4
感谢,我忘记了需要设置成 file路径了
请确保您已阅读以上注意事项,并勾选下方的确认框。
go-cqhttp 版本
v1.0.0-rc3
运行环境
Ubuntu
运行架构
ARM [64] (别名:AArch64 / ARMv8)
连接方式
WebSocket (反向)
使用协议
0 | iPad
重现步骤
已经尝试使用了 ffmpeg 将视频转换,但是还是无法发送
期望的结果是什么?
成功发送视频
实际的结果是什么?
转换CQ码 ({"type": "video", "data": {"file": "/data/bot/noneBot2/nonebot2/plugins/aaa.mp4", "cache": null, "proxy": null, "timeout": null}}) 到MiraiGo Element时出现错误: invalid video 将忽略本段CQ码.
简单的复现代码/链接(可选)
日志记录(可选)
No response
补充说明(可选)
No response