kexue-z / nonebot-plugin-setu-now

不可以涩涩
MIT License
115 stars 19 forks source link

图片保存到本地,如果图片名字中带 / 就会报错找不到目录 #25

Closed Zzzzzzouhang closed 2 years ago

Zzzzzzouhang commented 2 years ago

06-07 21:43:53 [ERROR] nonebot | Running matcher <Matcher from nonebot_plugin_setu_now, type=message, priority=1, temp=False> failed. Traceback (most recent call last): File "/root/miniconda3/lib/python3.9/site-packages/nonebot/message.py", line 146, in _check_matcher await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)

File "/root/miniconda3/lib/python3.9/site-packages/nonebot/message.py", line 196, in _run_matcher await matcher.run(bot, event, state, stack, dependency_cache) File "/root/miniconda3/lib/python3.9/site-packages/nonebot/internal/matcher.py", line 668, in run await self.simple_run(bot, event, state, stack, dependency_cache) File "/root/miniconda3/lib/python3.9/site-packages/nonebot/internal/matcher.py", line 635, in simple_run await handler( File "/root/miniconda3/lib/python3.9/site-packages/nonebot/dependencies/init.py", line 92, in call return await self.call(*values) File "/root/miniconda3/lib/python3.9/site-packages/nonebot_plugin_setunow/init.py", line 94, in await save_img(setu) File "/root/miniconda3/lib/python3.9/site-packages/nonebot_plugin_setu_now/save_to_local.py", line 29, in save_img async with await open_file(str(path), "wb+") as f: File "/root/miniconda3/lib/python3.9/site-packages/anyio/_core/_fileio.py", line 197, in open_file fp = await to_thread.run_sync( File "/root/miniconda3/lib/python3.9/site-packages/anyio/to_thread.py", line 31, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "/root/miniconda3/lib/python3.9/site-packages/anyio/_backends/_asyncio.py", line 937, in run_sync_in_worker_thread return await future File "/root/miniconda3/lib/python3.9/site-packages/anyio/_backends/_asyncio.py", line 867, in run result = context.run(func, args) FileNotFoundError: [Errno 2] No such file or directory: '/bot_linux/OneBot/data/setu/87293151_0_Skadi 25/1/2021_INNIYIK.jpg'

kexue-z commented 2 years ago

看看 .env 配置

Zzzzzzouhang commented 2 years ago

image 没单独配置位置