Skip to content
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

保存图片出错:[400] {"message":"Invalid Recipient(s)","code":50033} #1

Open
NiuBoss123 opened this issue Jun 29, 2024 · 15 comments

Comments

@NiuBoss123
Copy link

具体情况

d8248db0c429c4730c0e47683ec000f5_720

系统配置

  • Ubuntu 22.04 Server
  • Koishi 在 Docker 下运行

日志输出

2024-06-29 12:25:16 [I] cave 用户输入: undefined
@axlmly
Copy link
Owner

axlmly commented Jun 29, 2024

具体情况

d8248db0c429c4730c0e47683ec000f5_720

系统配置

  • Ubuntu 22.04 Server
  • Koishi 在 Docker 下运行

日志输出

2024-06-29 12:25:16 [I] cave 用户输入: undefined

更新了,再试试

@NiuBoss123
Copy link
Author

更新了,再试试

还是有问题

08cd038d65eca34e032777e19461edfc

日志输出

2024-06-30 02:04:59 [I] loader reload plugin cave:cwsiy3
2024-06-30 02:07:39 [I] cave 用户输入: https://multimedia.nt.qq.com.cn/download?appid=1407&fileid=CgoxMDY3MTQzODcwEhSUin7jkA3GJ2-hrirXyxEuRkTQ8hjZtQ8g_woolMS157OBhwNQgL2jAQ&spec=0&rkey=CAISKKSBekjVG1fMUS7Yi39HsVC2OASzwxtWFLWupDl37C6NIAg5lLOmk2U
2024-06-30 02:07:39 [I] cave 提取到的图片链接:https://multimedia.nt.qq.com.cn/download?appid=1407&fileid=CgoxMDY3MTQzODcwEhSUin7jkA3GJ2-hrirXyxEuRkTQ8hjZtQ8g_woolMS157OBhwNQgL2jAQ&spec=0&rkey=CAISKKSBekjVG1fMUS7Yi39HsVC2OASzwxtWFLWupDl37C6NIAg5lLOmk2U
2024-06-30 02:07:41 [I] cave 保存图片出错:[400] {"message":"Invalid Recipient(s)","code":50033}

@axlmly
Copy link
Owner

axlmly commented Jun 29, 2024

更新了,再试试

还是有问题

08cd038d65eca34e032777e19461edfc

日志输出

2024-06-30 02:04:59 [I] loader reload plugin cave:cwsiy3
2024-06-30 02:07:39 [I] cave 用户输入: https://multimedia.nt.qq.com.cn/download?appid=1407&fileid=CgoxMDY3MTQzODcwEhSUin7jkA3GJ2-hrirXyxEuRkTQ8hjZtQ8g_woolMS157OBhwNQgL2jAQ&spec=0&rkey=CAISKKSBekjVG1fMUS7Yi39HsVC2OASzwxtWFLWupDl37C6NIAg5lLOmk2U
2024-06-30 02:07:39 [I] cave 提取到的图片链接:https://multimedia.nt.qq.com.cn/download?appid=1407&fileid=CgoxMDY3MTQzODcwEhSUin7jkA3GJ2-hrirXyxEuRkTQ8hjZtQ8g_woolMS157OBhwNQgL2jAQ&spec=0&rkey=CAISKKSBekjVG1fMUS7Yi39HsVC2OASzwxtWFLWupDl37C6NIAg5lLOmk2U
2024-06-30 02:07:41 [I] cave 保存图片出错:[400] {"message":"Invalid Recipient(s)","code":50033}

你看看你配置里的管理员账号怎么填的,这个问题是发送不了私聊,是否正确填写了qq号,或是否有好友

@NiuBoss123
Copy link
Author

你看看你配置里的管理员账号怎么填的,这个问题是发送不了私聊,是否正确填写了qq号,或是否有好友

配置里是这样的
362cae2a87ca2ecf4e4ba29d1c86b6d3

另外哪怕是私聊状态下也是之前的情况(很早就加了机器人的账号)
a81a3f375cf1f41f89127c669c072021

日志(和之前一样):

2024-06-30 08:19:35 [I] cave 用户输入: https://multimedia.nt.qq.com.cn/download?appid=1406&fileid=CgoxMDY3MTQzODcwEhSUin7jkA3GJ2-hrirXyxEuRkTQ8hjZtQ8g_goorc_2-YaChwM&spec=0&rkey=CAMSKMa3OFokB_TlUBnIweDUftXe6ZKha6Dn4QzJXJXHhA1VsLk7pvrmSB8
2024-06-30 08:19:35 [I] cave 提取到的图片链接:https://multimedia.nt.qq.com.cn/download?appid=1406&fileid=CgoxMDY3MTQzODcwEhSUin7jkA3GJ2-hrirXyxEuRkTQ8hjZtQ8g_goorc_2-YaChwM&spec=0&rkey=CAMSKMa3OFokB_TlUBnIweDUftXe6ZKha6Dn4QzJXJXHhA1VsLk7pvrmSB8
2024-06-30 08:19:36 [I] cave 保存图片出错:[400] {"message":"Invalid Recipient(s)","code":50033}

@axlmly
Copy link
Owner

axlmly commented Jun 30, 2024

你看看你配置里的管理员账号怎么填的,这个问题是发送不了私聊,是否正确填写了qq号,或是否有好友

配置里是这样的
362cae2a87ca2ecf4e4ba29d1c86b6d3

另外哪怕是私聊状态下也是之前的情况(很早就加了机器人的账号)
a81a3f375cf1f41f89127c669c072021

日志(和之前一样):

2024-06-30 08:19:35 [I] cave 用户输入: https://multimedia.nt.qq.com.cn/download?appid=1406&fileid=CgoxMDY3MTQzODcwEhSUin7jkA3GJ2-hrirXyxEuRkTQ8hjZtQ8g_goorc_2-YaChwM&spec=0&rkey=CAMSKMa3OFokB_TlUBnIweDUftXe6ZKha6Dn4QzJXJXHhA1VsLk7pvrmSB8
2024-06-30 08:19:35 [I] cave 提取到的图片链接:https://multimedia.nt.qq.com.cn/download?appid=1406&fileid=CgoxMDY3MTQzODcwEhSUin7jkA3GJ2-hrirXyxEuRkTQ8hjZtQ8g_goorc_2-YaChwM&spec=0&rkey=CAMSKMa3OFokB_TlUBnIweDUftXe6ZKha6Dn4QzJXJXHhA1VsLk7pvrmSB8
2024-06-30 08:19:36 [I] cave 保存图片出错:[400] {"message":"Invalid Recipient(s)","code":50033}

请问您使用的适配器是onebot吗,或是red之类的。
请到koishi下的data文件夹中进入cave文件夹里的pictures查看是否有图片。如果有,请私聊你的bot使用审核回声洞 -t +你的bot提示你提交的id。然后再使用cave指令调用试试。如果这样操作正常,那应该只是我写的私聊发送功能暂时不支持该适配器,请等待适配。如果不正常,请再次发送错误日志

@NiuBoss123
Copy link
Author

请问您使用的适配器是onebot吗,或是red之类的。 请到koishi下的data文件夹中进入cave文件夹里的pictures查看是否有图片。如果有,请私聊你的bot使用审核回声洞 -t +你的bot提示你提交的id。然后再使用cave指令调用试试。如果这样操作正常,那应该只是我写的私聊发送功能暂时不支持该适配器,请等待适配。如果不正常,请再次发送错误日志

适配器是 onebot

cave 文件夹里确实有图片,但仍旧发不出来,不管是私聊还是群聊都一样

聊天记录

私聊:
353d44189ffb251f85cae23bccb11966

群聊:
46fd6a7cd9a44f55824d764f6d91ab3c

日志

2024-07-01 02:33:40 [W] session Error: Error with request send_private_msg, args: {"user_id":1067143870,"message":[{"type":"text","data":{"text":"回声洞 —— (9)"}},{"type":"text","data":{"text":"\n"}},{"type":"image","data":{"file":"/koishi/data/cave/pictures/3.png","cache":0}},{"type":"text","data":{"text":"—— Misaka Akio 御坂秋生"}}]}, retcode: 1200
                            at _Internal._get (/koishi/node_modules/koishi-plugin-adapter-onebot/lib/index.js:120:11)
                            at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
                            at async _Internal.<computed> [as sendPrivateMsg] (/koishi/node_modules/koishi-plugin-adapter-onebot/lib/index.js:160:20)
                            at async OneBotMessageEncoder.flush (/koishi/node_modules/koishi-plugin-adapter-onebot/lib/index.js:780:227)
                            at async OneBotMessageEncoder.send (/koishi/node_modules/@satorijs/core/lib/index.cjs:616:5)
                            at async Proxy.sendMessage (/koishi/node_modules/@satorijs/core/lib/index.cjs:346:22)
2024-07-01 02:33:58 [W] session Error: Error with request send_group_msg, args: {"group_id":1033965998,"message":[{"type":"text","data":{"text":"回声洞 —— (9)"}},{"type":"text","data":{"text":"\n"}},{"type":"image","data":{"file":"/koishi/data/cave/pictures/3.png","cache":0}},{"type":"text","data":{"text":"—— Misaka Akio 御坂秋生"}}]}, retcode: 1200
                            at _Internal._get (/koishi/node_modules/koishi-plugin-adapter-onebot/lib/index.js:120:11)
                            at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
                            at async _Internal.<computed> [as sendGroupMsg] (/koishi/node_modules/koishi-plugin-adapter-onebot/lib/index.js:160:20)
                            at async OneBotMessageEncoder.flush (/koishi/node_modules/koishi-plugin-adapter-onebot/lib/index.js:780:330)
                            at async OneBotMessageEncoder.send (/koishi/node_modules/@satorijs/core/lib/index.cjs:616:5)
                            at async Proxy.sendMessage (/koishi/node_modules/@satorijs/core/lib/index.cjs:346:22)

@axlmly
Copy link
Owner

axlmly commented Jun 30, 2024

请问您使用的适配器是onebot吗,或是red之类的。 请到koishi下的data文件夹中进入cave文件夹里的pictures查看是否有图片。如果有,请私聊你的bot使用审核回声洞 -t +你的bot提示你提交的id。然后再使用cave指令调用试试。如果这样操作正常,那应该只是我写的私聊发送功能暂时不支持该适配器,请等待适配。如果不正常,请再次发送错误日志

适配器是 onebot

cave 文件夹里确实有图片,但仍旧发不出来,不管是私聊还是群聊都一样

聊天记录

私聊:
353d44189ffb251f85cae23bccb11966

群聊:
46fd6a7cd9a44f55824d764f6d91ab3c

日志

2024-07-01 02:33:40 [W] session Error: Error with request send_private_msg, args: {"user_id":1067143870,"message":[{"type":"text","data":{"text":"回声洞 —— (9)"}},{"type":"text","data":{"text":"\n"}},{"type":"image","data":{"file":"/koishi/data/cave/pictures/3.png","cache":0}},{"type":"text","data":{"text":"—— Misaka Akio 御坂秋生"}}]}, retcode: 1200
                            at _Internal._get (/koishi/node_modules/koishi-plugin-adapter-onebot/lib/index.js:120:11)
                            at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
                            at async _Internal.<computed> [as sendPrivateMsg] (/koishi/node_modules/koishi-plugin-adapter-onebot/lib/index.js:160:20)
                            at async OneBotMessageEncoder.flush (/koishi/node_modules/koishi-plugin-adapter-onebot/lib/index.js:780:227)
                            at async OneBotMessageEncoder.send (/koishi/node_modules/@satorijs/core/lib/index.cjs:616:5)
                            at async Proxy.sendMessage (/koishi/node_modules/@satorijs/core/lib/index.cjs:346:22)
2024-07-01 02:33:58 [W] session Error: Error with request send_group_msg, args: {"group_id":1033965998,"message":[{"type":"text","data":{"text":"回声洞 —— (9)"}},{"type":"text","data":{"text":"\n"}},{"type":"image","data":{"file":"/koishi/data/cave/pictures/3.png","cache":0}},{"type":"text","data":{"text":"—— Misaka Akio 御坂秋生"}}]}, retcode: 1200
                            at _Internal._get (/koishi/node_modules/koishi-plugin-adapter-onebot/lib/index.js:120:11)
                            at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
                            at async _Internal.<computed> [as sendGroupMsg] (/koishi/node_modules/koishi-plugin-adapter-onebot/lib/index.js:160:20)
                            at async OneBotMessageEncoder.flush (/koishi/node_modules/koishi-plugin-adapter-onebot/lib/index.js:780:330)
                            at async OneBotMessageEncoder.send (/koishi/node_modules/@satorijs/core/lib/index.cjs:616:5)
                            at async Proxy.sendMessage (/koishi/node_modules/@satorijs/core/lib/index.cjs:346:22)

对不起,这超出我的能力范围了,我完全不知道为什么会1200,您有尝试过使用其他账号或用其他插件发送过图片并且正常吗

@NiuBoss123
Copy link
Author

对不起,这超出我的能力范围了,我完全不知道为什么会1200,您有尝试过使用其他账号或用其他插件发送过图片并且正常吗

其他插件是正常的,我还没试着用另一个账号(另一个早就被封了(

手动调整 /data/cave/cave.json 的内容后,在只保留一条纯文本内容和纯图片内容的情况下,纯文本内容可以发出,但纯图片内容无法发出,可能跟图片路径的设置有关,或者跟使用 base64 发送消息有关(Nonebot 那边也有人说这个事情)


附:Onebot V11 消息段类型 图片:https://github.com/botuniverse/onebot-11/blob/master/message/segment.md#%E5%9B%BE%E7%89%87

Koishi 消息元素 嵌入图片和其他资源:https://koishi.chat/zh-CN/guide/basic/element.html#%E5%B5%8C%E5%85%A5%E5%9B%BE%E7%89%87%E5%92%8C%E5%85%B6%E4%BB%96%E8%B5%84%E6%BA%90

(在收到回复前此条消息可能会再度修改)

@axlmly
Copy link
Owner

axlmly commented Sep 22, 2024

对不起,这超出我的能力范围了,我完全不知道为什么会1200,您有尝试过使用其他账号或用其他插件发送过图片并且正常吗

其他插件是正常的,我还没试着用另一个账号(另一个早就被封了(

手动调整 /data/cave/cave.json 的内容后,在只保留一条纯文本内容和纯图片内容的情况下,纯文本内容可以发出,但纯图片内容无法发出,可能跟图片路径的设置有关,或者跟使用 base64 发送消息有关(Nonebot 那边也有人说这个事情)

附:Onebot V11 消息段类型 图片:https://github.com/botuniverse/onebot-11/blob/master/message/segment.md#%E5%9B%BE%E7%89%87

Koishi 消息元素 嵌入图片和其他资源:https://koishi.chat/zh-CN/guide/basic/element.html#%E5%B5%8C%E5%85%A5%E5%9B%BE%E7%89%87%E5%92%8C%E5%85%B6%E4%BB%96%E8%B5%84%E6%BA%90

(在收到回复前此条消息可能会再度修改)

我开始着手这个问题,能请更新到1.1.3后测试回报吗

@NiuBoss123
Copy link
Author

NiuBoss123 commented Sep 24, 2024

我开始着手这个问题,能请更新到1.1.3后测试回报吗

错误日志

2024-09-24 15:35:50 [W] session Error: Error with request send_group_msg, args: {"group_id":983882117,"message":[{"type":"text","data":{"text":"回声洞 —— [ 1 ]"}},{"type":"text","data":{"text":"\n"}},{"type":"image","data":{"file":"/koishi/data/cave/pictures/1.png","cache":0}},{"type":"text","data":{"text":"—— 1067143870"}}]}, retcode: 1200
                            at _Internal._get (/koishi/node_modules/koishi-plugin-adapter-onebot/lib/index.js:119:11)
                            at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
                            at async _Internal.<computed> [as sendGroupMsg] (/koishi/node_modules/koishi-plugin-adapter-onebot/lib/index.js:162:20)
                            at async OneBotMessageEncoder.flush (/koishi/node_modules/koishi-plugin-adapter-onebot/lib/index.js:761:330)
                            at async OneBotMessageEncoder.send (/koishi/node_modules/@satorijs/core/lib/index.cjs:620:5)
                            at async Proxy.sendMessage (/koishi/node_modules/@satorijs/core/lib/index.cjs:355:22)

和之前一样,还是1200错误,但之前是 send_private_msg,现在是 send_group_msg

比较尴尬的是,QQ官方机器人API下是另一个错误,腾讯要求URL白名单导致的(我因为没给域名做备案所以没做这个设置),这说明QQ机器人适配器那边工作正常

2024-09-24 15:36:26 [W] session TypeError: Invalid URL
                            at new URL (node:internal/url:797:36)
                            at Proxy.isLocal (/koishi/node_modules/@cordisjs/plugin-http/lib/index.cjs:412:34)
                            at Object.apply (/koishi/node_modules/@satorijs/core/node_modules/@cordisjs/core/lib/index.cjs:178:40)
                            at QQMessageEncoder.sendFile (/koishi/node_modules/@satorijs/adapter-qq/lib/index.cjs:1057:40)
                            at QQMessageEncoder.visit (/koishi/node_modules/@satorijs/adapter-qq/lib/index.cjs:1126:31)
                            at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
                            at async QQMessageEncoder.render (/koishi/node_modules/@satorijs/core/lib/index.cjs:593:7)
                            at async QQMessageEncoder.send (/koishi/node_modules/@satorijs/core/lib/index.cjs:619:5)
                            at async Proxy.sendMessage (/koishi/node_modules/@satorijs/core/lib/index.cjs:355:22)

可能还是和 onebot 的兼容有关

@axlmly
Copy link
Owner

axlmly commented Sep 24, 2024

我开始着手这个问题,能请更新到1.1.3后测试回报吗

错误日志

2024-09-24 15:35:50 [W] session Error: Error with request send_group_msg, args: {"group_id":983882117,"message":[{"type":"text","data":{"text":"回声洞 —— [ 1 ]"}},{"type":"text","data":{"text":"\n"}},{"type":"image","data":{"file":"/koishi/data/cave/pictures/1.png","cache":0}},{"type":"text","data":{"text":"—— 1067143870"}}]}, retcode: 1200
                            at _Internal._get (/koishi/node_modules/koishi-plugin-adapter-onebot/lib/index.js:119:11)
                            at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
                            at async _Internal.<computed> [as sendGroupMsg] (/koishi/node_modules/koishi-plugin-adapter-onebot/lib/index.js:162:20)
                            at async OneBotMessageEncoder.flush (/koishi/node_modules/koishi-plugin-adapter-onebot/lib/index.js:761:330)
                            at async OneBotMessageEncoder.send (/koishi/node_modules/@satorijs/core/lib/index.cjs:620:5)
                            at async Proxy.sendMessage (/koishi/node_modules/@satorijs/core/lib/index.cjs:355:22)

和之前一样,还是1200错误,但之前是 send_private_msg,现在是 send_group_msg

比较尴尬的是,QQ官方机器人API下是另一个错误,腾讯要求URL白名单导致的(我因为没给域名做备案所以没做这个设置),这说明QQ机器人适配器那边工作正常

2024-09-24 15:36:26 [W] session TypeError: Invalid URL
                            at new URL (node:internal/url:797:36)
                            at Proxy.isLocal (/koishi/node_modules/@cordisjs/plugin-http/lib/index.cjs:412:34)
                            at Object.apply (/koishi/node_modules/@satorijs/core/node_modules/@cordisjs/core/lib/index.cjs:178:40)
                            at QQMessageEncoder.sendFile (/koishi/node_modules/@satorijs/adapter-qq/lib/index.cjs:1057:40)
                            at QQMessageEncoder.visit (/koishi/node_modules/@satorijs/adapter-qq/lib/index.cjs:1126:31)
                            at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
                            at async QQMessageEncoder.render (/koishi/node_modules/@satorijs/core/lib/index.cjs:593:7)
                            at async QQMessageEncoder.send (/koishi/node_modules/@satorijs/core/lib/index.cjs:619:5)
                            at async Proxy.sendMessage (/koishi/node_modules/@satorijs/core/lib/index.cjs:355:22)

可能还是和 onebot 的兼容有关

能查看下cave.json吗

@NiuBoss123
Copy link
Author

NiuBoss123 commented Sep 25, 2024

能查看下cave.json吗

cave.json

[
  {
    "cave_id": 1,
    "message": [
      {
        "type": "image",
        "path": "/koishi/data/cave/pictures/1.png"
      }
    ],
    "contributor_id": "1067143870",
    "state": 0
  }
]

1.png是存在的,

@axlmly
Copy link
Owner

axlmly commented Sep 25, 2024

能查看下cave.json吗

cave.json

[
  {
    "cave_id": 1,
    "message": [
      {
        "type": "image",
        "path": "/koishi/data/cave/pictures/1.png"
      }
    ],
    "contributor_id": "1067143870",
    "state": 0
  }
]

1.png是存在的,

你这不对啊,path里该是绝对路径啊
"message": [
{
"type": "image",
"path": "C:\Users\xiuzh\AppData\Roaming\Koishi\Desktop\data\instances\default\data\cave\pictures\2_1.jpeg"
}
],这样才对。你试试改成绝对路径

@NiuBoss123
Copy link
Author

NiuBoss123 commented Sep 30, 2024

你这不对啊,path里该是绝对路径啊
"message": [
{
"type": "image",
"path": "C:\Users\xiuzh\AppData\Roaming\Koishi\Desktop\data\instances\default\data\cave\pictures\2_1.jpeg"
}
],这样才对。你试试改成绝对路径

我是在 Docker 内运作的,生成的路径就是这样的(抱歉之前忘了说,如果这一个地方必须是绝对路径的话那对 Docker 来说是硬伤了)

@axlmly
Copy link
Owner

axlmly commented Oct 16, 2024

你这不对啊,path里该是绝对路径啊
"message": [
{
"type": "image",
"path": "C:\Users\xiuzh\AppData\Roaming\Koishi\Desktop\data\instances\default\data\cave\pictures\2_1.jpeg"
}
],这样才对。你试试改成绝对路径

我是在 Docker 内运作的,生成的路径就是这样的(抱歉之前忘了说,如果这一个地方必须是绝对路径的话那对 Docker 来说是硬伤了)

请尝试更新新版本

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants