koishijs / koishi

Cross-platform chatbot framework made with love
https://koishi.chat
MIT License
4.54k stars 249 forks source link

Bug: QQ频道发送图片错误。 #1144

Closed MRDHR closed 1 year ago

MRDHR commented 1 year ago

Describe the bug

Error: Error with request send_guild_channel_msg, args: {"guild_id":"xxxxx","channel_id":"xxxx","message":{"type":"image","attrs":{"url":"https://res.mrdvh.com/vi/UiQxUwp6jGA/maxresdefault.jpg"},"children":[]}}, retcode: 100 at _Internal._get (D:\WebstormProjects\MrdBot3\node_modules\@satorijs\adapter-onebot\src\types.ts:558:11) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at _Internal._Internal. (D:\WebstormProjects\MrdBot3\node_modules\@satorijs\adapter-onebot\src\types.ts:595:20)

Steps to reproduce

myBot.internal.sendGuildChannelMsg(xxxxx, xxxxx, h('image', {
                                                            url: "https://xxsakldajsd"
                                                        }))

Expected behavior

图片发送成功

Screenshots

image

Versions

Additional context

No response

MRDHR commented 1 year ago

image 从日志看到是上传错误了

shigma commented 1 year ago

网络图片发送失败系 go-cqhttp 实现问题,与 Koishi 无关。你可以考虑转存本地或者向 go-cqhttp 仓库提交 issue。

MRDHR commented 1 year ago

好的,我试试转存本地。

shigma commented 1 year ago

哦还有一种办法就是发送前直接下载到 buffer。然后 h.image(buffer, mimetype) 发送。

总之这个问题应该算解决了。