Open Mcayear opened 1 month ago
QQ适配器发送私聊消息时出错
public async sendQQPrivateMsg(employeeName: string, content: h[]) { if (this.debug) { this.logger.info(content.toString()); } console.log(this.userInfo.qqid) if (this.employeeNoDisplay && employeeName.length) { this.qqBot.sendPrivateMessage(this.userInfo.qqid, [h.text("工号 " + employeeName + ": "), ...content]); } else { this.qqBot.sendPrivateMessage(this.userInfo.qqid, content); } }
2024-09-12 06:26:34 [I] http { data: null, url: 'https://sandbox.api.sgroup.qq.com/v2/groups/D7008FC26B8C34C05F54F4FB7CD1E3A8/messages', status: 500, statusText: 'Internal Server Error', headers: HeadersList { cookies: null, [Symbol(headers map)]: Map(8) { 'date' => { name: 'Date', value: 'Wed, 11 Sep 2024 22:26:33 GMT' }, 'content-type' => { name: 'Content-Type', value: 'application/json' }, 'content-length' => { name: 'Content-Length', value: '105' }, 'connection' => { name: 'Connection', value: 'keep-alive' }, 'x-tps-trace-id' => { name: 'X-Tps-Trace-Id', value: 'a620b1be6b2c44f6f6ef66bf5672282b' }, 'access-control-allow-credentials' => { name: 'Access-Control-Allow-Credentials', value: 'true' }, 'access-control-allow-methods' => { name: 'Access-Control-Allow-Methods', value: 'GET, POST, OPTIONS' }, 'access-control-allow-headers' => { name: 'Access-Control-Allow-Headers', value: 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization,authorization' } }, [Symbol(headers map sorted)]: null } } 2024-09-12 06:26:34 [W] app Error: Internal Server Error at [cordis.invoke] (D:\koishi-app\node_modules\@cordisjs\plugin-http\lib\index.cjs:335:23) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at GroupInternal.<computed> (D:\koishi-app\node_modules\@satorijs\adapter-qq\src\internal\internal.ts:33:32) at send (D:\koishi-app\node_modules\@satorijs\adapter-qq\src\message.ts:250:13) at QQMessageEncoder.flush (D:\koishi-app\node_modules\@satorijs\adapter-qq\src\message.ts:278:5) at QQMessageEncoder.send (D:\koishi-app\node_modules\@satorijs\core\src\message.ts:54:5) at Proxy.sendMessage (D:\koishi-app\node_modules\@satorijs\core\src\bot.ts:188:22)
使用 qqBot 发送私聊消息。
发现 API 调用与预期不符,报错中的 /v2/groups/D7008FC26B8C34C05F54F4FB7CD1E3A8/messages 是发送群聊消息。
/v2/groups/D7008FC26B8C34C05F54F4FB7CD1E3A8/messages
而 开发者文档 中要求使用 /v2/users/{openid}/messages 来发送私聊消息。
/v2/users/{openid}/messages
No response
System: OS: Windows 10 10.0.19045 CPU: (8) x64 Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
Binaries: Node: 20.11.0 Yarn: 4.1.1
Koishi: Core: 4.17.12 Console: 5.29.3
adapter-qq: v4.8.2
可以复现。@koishijs/plugin-adapter-qq@4.8.2
@koishijs/plugin-adapter-qq@4.8.2
(我使用的 send 指令同 @koishijs/plugin-echo 的 echo)
Describe the bug
QQ适配器发送私聊消息时出错
Steps to reproduce
使用 qqBot 发送私聊消息。
Expected behavior
发现 API 调用与预期不符,报错中的
/v2/groups/D7008FC26B8C34C05F54F4FB7CD1E3A8/messages
是发送群聊消息。而 开发者文档 中要求使用
/v2/users/{openid}/messages
来发送私聊消息。Screenshots
No response
Versions
System: OS: Windows 10 10.0.19045 CPU: (8) x64 Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
Binaries: Node: 20.11.0 Yarn: 4.1.1
Koishi: Core: 4.17.12 Console: 5.29.3
Additional context
adapter-qq: v4.8.2