-
Notifications
You must be signed in to change notification settings - Fork 4
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
Napcat端由于图片缓存格式不同导致无法正常设置问题 #15
Labels
wontfix
This will not be worked on
Comments
麻烦尝试一下将 async def doing_img(bot, img: str, is_ans: bool = False, save: bool = False) -> str:
img_path = os.path.join(FILE_PATH, 'img/')
if save:
logger.info('开始调用get_image接口获取图片信息')
img_url = await bot.get_image(file=img)
logger.info('图片信息接口返回:' + str(img_url))
file = os.path.join(img_path, img)
if not os.path.isfile(img_path + img):
urllib.request.urlretrieve(url=img_url['url'], filename=file)
logger.critical(f'XQA: 已下载图片{img}')
if is_ans: # 保证保存图片的完整性,方便迁移和后续做操作
return 'file:///' + os.path.abspath(img_path + img)
return img 之后再发送一次设置问题,然后截图一下hoshino的日志我看看napcat的接口返回的啥,只需要hoshino的日志就行 |
那我这没法解决了欸,你可以尝试携带napcat的日志去那边问问get_image这个接口现在正常不 |
mark一手便于后续跟进 |
你在 raw_body = raw_body if '.' in raw_body else raw_body + '.image' 然后直接吧这行删掉再试试 |
我去,他这接口返回的URL怎么变成路径了。。。。 |
看来是文件名不合法,我看看咋改 |
azmiao
added a commit
that referenced
this issue
Sep 2, 2024
更新下试试? |
ok |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
设置带图片的回复后,bot并不回复该问题。

hoshino后台日志

Napcat后台日志
2024-08-25 23:34:58 [ [32mINFO [39m] 芬里尔(438980368) | 群[尔威希、739039361、木华 陽、芬里尔(463922023)] 739039361(739039361): 开始测试
2024-08-25 23:35:02 [ [32mINFO [39m] 芬里尔(438980368) | 群[尔威希、739039361、木华 陽、芬里尔(463922023)] 739039361(739039361): 全群问这是一个
问题你答
[图片|https://gchat.qpic.cn/gchatpic_new/739039361/3953922023-2935700190-2A775A7BC55EABDA3BD8D99697B3A993/0?term=255&is_o
rigin=0]
2024-08-25 23:35:03 [ [91mERROR [39m] 芬里尔(438980368) | 发生错误 Error: file not found
at GetImage._handle (file:///C:/Users/Administrator/Desktop/%E8%BF%99%E4%B8%AA%E6%98%AF%E4%BD%A0%E7%9A%84%E6%9C%BA%E
5%99%A8%E4%BA%BA%E7%99%BB%E9%99%86/NapCat-new/NapCat.win32.x64/napcat.mjs:24445:11)
at async GetImage.websocketHandle (file:///C:/Users/Administrator/Desktop/%E8%BF%99%E4%B8%AA%E6%98%AF%E4%BD%A0%E7%9A
%84%E6%9C%BA%E5%99%A8%E4%BA%BA%E7%99%BB%E9%99%86/NapCat-new/NapCat.win32.x64/napcat.mjs:21764:23)
at async ReverseWebsocket.onmessage (file:///C:/Users/Administrator/Desktop/%E8%BF%99%E4%B8%AA%E6%98%AF%E4%BD%A0%E7%
9A%84%E6%9C%BA%E5%99%A8%E4%BA%BA%E7%99%BB%E9%99%86/NapCat-new/NapCat.win32.x64/napcat.mjs:27137:28)
at async WebSocket. (file:///C:/Users/Administrator/Desktop/%E8%BF%99%E4%B8%AA%E6%98%AF%E4%BD%A0%E7%9A%84
%E6%9C%BA%E5%99%A8%E4%BA%BA%E7%99%BB%E9%99%86/NapCat-new/NapCat.win32.x64/napcat.mjs:27177:7)
2024-08-25 23:35:03 [ [32mINFO [39m] 芬里尔(438980368) | 发送消息 给群聊 群[尔威希、739039361、木华 陽、芬里尔(463922023)] : 好的我记住了
2024-08-25 23:35:11 [ [32mINFO [39m] 芬里尔(438980368) | 群[尔威希、739039361、木华 陽、芬里尔(463922023)] 739039361(739039361): 这是一个问题
2024-08-25 23:35:11 [ [91mERROR [39m] 芬里尔(438980368) | 发生错误 Error: file not found
at GetImage._handle (file:///C:/Users/Administrator/Desktop/%E8%BF%99%E4%B8%AA%E6%98%AF%E4%BD%A0%E7%9A%84%E6%9C%BA%E
5%99%A8%E4%BA%BA%E7%99%BB%E9%99%86/NapCat-new/NapCat.win32.x64/napcat.mjs:24445:11)
at async GetImage.websocketHandle (file:///C:/Users/Administrator/Desktop/%E8%BF%99%E4%B8%AA%E6%98%AF%E4%BD%A0%E7%9A
%84%E6%9C%BA%E5%99%A8%E4%BA%BA%E7%99%BB%E9%99%86/NapCat-new/NapCat.win32.x64/napcat.mjs:21764:23)
at async ReverseWebsocket.onmessage (file:///C:/Users/Administrator/Desktop/%E8%BF%99%E4%B8%AA%E6%98%AF%E4%BD%A0%E7%
9A%84%E6%9C%BA%E5%99%A8%E4%BA%BA%E7%99%BB%E9%99%86/NapCat-new/NapCat.win32.x64/napcat.mjs:27137:28)
at async WebSocket. (file:///C:/Users/Administrator/Desktop/%E8%BF%99%E4%B8%AA%E6%98%AF%E4%BD%A0%E7%9A%84
%E6%9C%BA%E5%99%A8%E4%BA%BA%E7%99%BB%E9%99%86/NapCat-new/NapCat.win32.x64/napcat.mjs:27177:7)
2024-08-25 23:35:11 [ [91mERROR [39m] 芬里尔(438980368) | 发生错误 Error: ENOENT: no such file or directory, open 'C:\Users\Adm
inistrator\Desktop\Resources\img\xqa\img{2A775A7B-C55E-ABDA-3BD8-D99697B3A993}.png'
The text was updated successfully, but these errors were encountered: