Closed fatinghenji closed 1 year ago
我这边无法复现,请问可以提供更详细的信息吗,或者尝试重新安装 koishi 看是否会出现同样的问题
我目前感觉这些报错都不影响使用。你目前有收发消息异常的情况吗?
此外:如果可以请至少提供报错时间前后几分钟内的 go-cqhttp 日志。
似乎是 go-cqhttp 上报格式问题。array 报错,string 正常。
我目前感觉这些报错都没有影响使用。你目前有收发消息异常的情况吗?
此外:如果可以请至少提供报错时间前几分钟内的go-cqhttp日志。
在 array 下无法收发消息,string 下可以正常收发,我一会再测试下
在 array 下无法收发消息,string 下可以正常收发,我一会再测试下
测试后确定是这个位置的问题,将string
改为array
后,报错复现。
023-02-20 15:29:43 [W] adapter failed to connect to ws://127.0.0.1:6700, code: 1006, will retry in 5s...
2023-02-20 15:29:48 [W] adapter failed to connect to ws://127.0.0.1:6700, code: 1006, will retry in 5s...
2023-02-20 15:29:53 [W] adapter failed to connect to ws://127.0.0.1:6700, code: 1006, will retry in 5s...
2023-02-20 15:29:58 [W] adapter failed to connect to ws://127.0.0.1:6700, code: 1006, will retry in 5s...
2023-02-20 15:30:03 [W] adapter failed to connect to ws://127.0.0.1:6700, code: 1006, will retry in 5s...
2023-02-20 15:30:08 [W] adapter failed to connect to ws://127.0.0.1:6700, code: 1006, will retry in 5s...
2023-02-20 15:30:13 [W] adapter failed to connect to ws://127.0.0.1:6700, code: 1006, will retry in 1m...
2023-02-20 15:31:14 [I] adapter connect to server: ws://127.0.0.1:6700
2023-02-20 15:31:21 [W] app TypeError: Cannot read properties of undefined (reading 'replace')
at Function.escape (/home/vanthoff/koishi-app/node_modules/@satorijs/core/node_modules/@satorijs/element/lib/index.cjs:101:27)
at ElementConstructor.toString (/home/vanthoff/koishi-app/node_modules/@satorijs/core/node_modules/@satorijs/element/lib/index.cjs:37:51)
at Array.join (<anonymous>)
at adaptMessage (/home/vanthoff/koishi-app/node_modules/@satorijs/adapter-onebot/lib/index.js:315:36)
at adaptSession (/home/vanthoff/koishi-app/node_modules/@satorijs/adapter-onebot/lib/index.js:368:11)
at dispatchSession (/home/vanthoff/koishi-app/node_modules/@satorijs/adapter-onebot/lib/index.js:355:25)
at WebSocket.<anonymous> (/home/vanthoff/koishi-app/node_modules/@satorijs/adapter-onebot/lib/index.js:610:7)
at WebSocket.emit (node:events:512:28)
at Receiver.receiverOnMessage (/home/vanthoff/koishi-app/node_modules/ws/lib/websocket.js:1180:20)
at Receiver.emit (node:events:512:28)
是更改go-cqhttp
配置文件的这里:
message:
# 上报数据类型
# 可选: string,array
post-format: array
string则正常,array则报错。文档:适配器onebot中并未提到应使用string
而非array
。我同时还在使用其他的bot终端,他们需求的都为array
。
上面提到的go-cqhttp
日志文件如下(提供的为更改为array
后启动的日志):
➜ qq go-cqhttp -faststart
[2023-02-20 15:30:11] [INFO]: 当前版本:1.0.0-rc4
[2023-02-20 15:30:11] [INFO]: 将使用 device.json 内的设备信息运行Bot.
[2023-02-20 15:30:11] [INFO]: 开始尝试登录并同步消息...
[2023-02-20 15:30:11] [INFO]: 使用协议: Android Phone
[2023-02-20 15:30:17] [INFO]: Protocol -> connect to server: 116.130.229.12:8080
[2023-02-20 15:30:17] [WARNING]: Protocol -> device lock is disable. http api may fail.
[2023-02-20 15:30:20] [INFO]: 收到服务器地址更新通知, 将在下一次重连时应用.
[2023-02-20 15:30:21] [INFO]: 登录成功 欢迎使用: BOT
[2023-02-20 15:30:21] [INFO]: 开始加载好友列表...
[2023-02-20 15:30:21] [INFO]: 共加载 121 个好友.
[2023-02-20 15:30:21] [INFO]: 开始加载群列表...
[2023-02-20 15:30:22] [INFO]: 共加载 24 个群.
[2023-02-20 15:30:22] [INFO]: 资源初始化完成, 开始处理信息.
[2023-02-20 15:30:22] [INFO]: アトリは、高性能ですから!
[2023-02-20 15:30:22] [INFO]: 正在检查更新.
[2023-02-20 15:30:22] [INFO]: 开始尝试连接到反向WebSocket Universal服务器: wss://xn--v9x.net:443/ws/
[2023-02-20 15:30:22] [INFO]: 开始尝试连接到反向WebSocket Universal服务器: ws://127.0.0.1:8069/onebot/v11/ws/
[2023-02-20 15:30:22] [INFO]: 开始尝试连接到反向WebSocket Universal服务器: ws://127.0.0.1:20000/onebot/v11/ws
[2023-02-20 15:30:22] [INFO]: CQ HTTP 服务器已启动: [::]:5702
[2023-02-20 15:30:22] [INFO]: CQ WebSocket 服务器已启动: [::]:6700
[2023-02-20 15:30:22] [INFO]: CQ WebSocket 服务器已启动: [::]:5701
[2023-02-20 15:30:22] [INFO]: 已连接到反向WebSocket Universal服务器 ws://127.0.0.1:8069/onebot/v11/ws/
[2023-02-20 15:30:22] [INFO]: 已连接到反向WebSocket Universal服务器 ws://127.0.0.1:20000/onebot/v11/ws
[2023-02-20 15:30:22] [WARNING]: 检查更新失败!
[2023-02-20 15:30:22] [INFO]: 检查更新完成. 当前已运行最新版本.
[2023-02-20 15:30:22] [INFO]: 开始诊断网络情况
[2023-02-20 15:30:23] [INFO]: 接受 WebSocket 连接: 192.168.123.146:46536 (/)
[2023-02-20 15:30:25] [INFO]: 网络诊断完成. 未发现问题
[2023-02-20 15:30:29] [INFO]: 已连接到反向WebSocket Universal服务器 wss://xn--v9x.net:443/ws/
[2023-02-20 15:30:39] [INFO]: 收到群 明日方舟博士交流研讨(963856164) 内 兔兔妈(2909954314) 的消息: 兔兔 (2046914481)
[2023-02-20 15:30:40] [INFO]: 发送群 明日方舟博士交流研讨会(963856164) 的消息: [{"type": ... (-485999093)
[2023-02-20 15:30:44] [INFO]: 收到群 明日方舟博士交流研讨(963856164) 内 兔兔妈(2909954314) 的消息: 好了 (-1810952547)
[2023-02-20 15:31:05] [INFO]: 收到群 BOT、酷推、Пулемет (601022072) 内 Пулемет РП-46 (2909954314) 的消息: help (1755532220)
[2023-02-20 15:31:13] [INFO]: 接受 WebSocket 连接: 127.0.0.1:45894 (/)
[2023-02-20 15:31:21] [INFO]: 收到群 BOT、酷推、Пулемет (601022072) 内 Пулемет РП-46 (2909954314) 的消息: help (140821081)
注意时间点,go-cqhttp
成功链接到了koishi-bot
,并接收到了消息:
[2023-02-20 15:31:13] [INFO]: 接受 WebSocket 连接: 127.0.0.1:45894 (/)
[2023-02-20 15:31:05] [INFO]: 收到群 BOT、酷推、Пулемет (601022072) 内 Пулемет РП-46 (2909954314) 的消息: help
稍后koishi控制台抛出错误:
2023-02-20 15:31:21 [W] app TypeError: Cannot read properties of undefined (reading 'replace')
我这边无法复现,请问可以提供更详细的信息吗,或者尝试重新安装 koishi 看是否会出现同样的问题
我尝试了两种方法,一种是使用koishi-android
,另一种是直接安装,都存在这个问题。我是不是在错误的地方提出issue了?是否应该归为koishi项目下?
确实可能是 array 的问题。我之后看一下。
我尝试了两种方法,一种是使用
koishi-android
,另一种是直接安装,都存在这个问题。我是不是在错误的地方提出issue了?是否应该归为koishi项目下?
是的。我来 transfer。
此问题已修复。@koishijs/plugin-adapter-onebot 刚刚发布了 5.5.5 版本。
上面还有一个插件市场的报错,不清楚是否与改问题相关: