更新后QQ机器人WebHook启动报错,但消息收发正常

碰到的奇怪问题,更新了 Koishi 到 4.18.8,adapter-qq 到 4.10.0,其他的都没变。

机器人启动或 reload 时,控制台会报 Warning:

qq TypeError: Cannot convert undefined or null to object
    at Function.assign (<anonymous>)
    at QQBot.initialize (/koishi/node_modules/@koishijs/plugin-adapter-qq/node_modules/@satorijs/adapter-qq/lib/index.cjs:1898:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async HttpServer.initialize (/koishi/node_modules/@koishijs/plugin-adapter-qq/node_modules/@satorijs/adapter-qq/lib/index.cjs:1824:7)
    at async HttpServer.connect (/koishi/node_modules/@koishijs/plugin-adapter-qq/node_modules/@satorijs/adapter-qq/lib/index.cjs:1785:5)
    at async QQBot.start (/koishi/node_modules/@satorijs/core/lib/index.cjs:440:7)

此时若尝试给机器人发消息,还会有类似的报错输出,但机器人的回复消息可抵达用户端

20250531-212823

报错输出如下:

qq TypeError: Cannot convert undefined or null to object
    at Function.assign (<anonymous>)
    at QQBot.initialize (/koishi/node_modules/@koishijs/plugin-adapter-qq/node_modules/@satorijs/adapter-qq/lib/index.cjs:1898:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async HttpServer.initialize (/koishi/node_modules/@koishijs/plugin-adapter-qq/node_modules/@satorijs/adapter-qq/lib/index.cjs:1824:7)
    at async /koishi/node_modules/@koishijs/plugin-adapter-qq/node_modules/@satorijs/adapter-qq/lib/index.cjs:1806:11
    at async Server._body (/koishi/node_modules/@cordisjs/plugin-server/lib/index.cjs:131:7)

此时机器人状态是离线:

20250531-212858

看报错的地方,可能挂在了这里

现在如果通过 web 管理页面单独把 adapter-qq 版本恢复成旧版(4.9.2),依旧报相同的错误,请问有人遇到类似的现象吗?

2 个赞

我遇到了,如果不用hook的话会没有回复,用hook的话会说离线

2 个赞

QQ 一旦设置了 WebHook 后,WebSocket 的就不能用了,你描述的 WebSocket 收不到消息现象是符合预期的。

看起来 WebHook 报错离线的问题不是个例?我这边配置啥的都没变。我也尝试了关掉所有三方插件,仅保留核心插件,依旧报错 + 离线。

1 个赞