Ailitonia / omega-miya

基于 nonebot2 的多平台机器人
MIT License
272 stars 50 forks source link

求助:动态图片发送失败 #143

Closed longyajr closed 5 months ago

longyajr commented 5 months ago

报错说找不到这个图片文件,但是这个图片确实存在于对应目录下 06-19 02:29:10 [WARNING] bilibili_dynamic_monitor | BilibiliDynamicMonitor | Sending message to Entity.onebot_v11_user(id=4, entity_id=, name=) failed with ActionFailed, ActionFailed(status='failed', retcode=1200, data=None, message="Error: ENOENT: no such file or directory, open '/home/ubuntu/bot/RemoteBotTest6/omega-miya/.tmp/bilibili/download/f3ae91084c6358f1fb954186f01c2ba31238329219.png'", wording="Error: ENOENT: no such file or directory, open '/home/ubuntu/bot/RemoteBotTest6/omega-miya/.tmp/bilibili/download/f3ae91084c6358f1fb954186f01c2ba31238329219.png'", echo='42') 日志: 20240619-022601-INFO.log

longyajr commented 5 months ago

好像所有涉及到发送图片的功能都有这个问题……

Ailitonia commented 5 months ago

你的 bot 客户端和 nonebot2 是在同一个环境下吗?有没有使用 docker 之类的容器?

longyajr commented 5 months ago

napcat是在docker上,bot和nonebot2是在虚拟环境上(venv)

Ailitonia commented 5 months ago

在 docker 容器内一般是不能直接访问宿主环境里面文件的,建议咨询下NapCatQQ 社区该如何配置

longyajr commented 5 months ago

谢谢解答,我修改了docker的挂载目录,使得我的docker可以直接访问到 将宿主的/home/user 挂载到docker的/home/user,这样两者访问的路径就能恰好对上了。 再次感谢您的帮助!