wangrongding / wechat-bot

🤖一个基于 WeChaty 结合 OpenAi ChatGPT / Kimi / 讯飞等Ai服务实现的微信机器人 ,可以用来帮助你自动回复微信消息,或者管理微信群/好友,检测僵尸粉等...
MIT License
5.59k stars 771 forks source link

讯飞配置好后发送请求遇到 socket 连接关闭错误 #196

Open wenzhiquan opened 4 months ago

wenzhiquan commented 4 months ago
Current time:Thu Jul 11 2024 11:17:32 GMT+0800 (China Standard Time)
Automatic robot chat mode has been activated
🌸🌸🌸 / content:  请给我推荐一个上海好吃的饭店
🚀🚀🚀 / prompt 请给我推荐一个上海好吃的饭店
socket 连接关闭
AssertionError [ERR_ASSERTION]: 1204 == 0
    at Object.equal (/Users/elvin.wen/local/wechat-bot/node_modules/wechat4u/lib/util/global.js:69:24)
    at /Users/elvin.wen/local/wechat-bot/node_modules/wechat4u/lib/core.js:537:24
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async PuppetWechat4u.messageSendText (file:///Users/elvin.wen/local/wechat-bot/node_modules/wechaty-puppet-wechat4u/dist/esm/src/puppet-wechat4u.js:616:9)
    at async WechatifiedUserClass.say (file:///Users/elvin.wen/local/wechat-bot/node_modules/wechaty/dist/esm/src/user-modules/contact.js:274:23)
    at async defaultMessage (file:///Users/elvin.wen/local/wechat-bot/src/wechaty/sendMessage.js:52:7)
    at async WechatyImpl.onMessage (file:///Users/elvin.wen/local/wechat-bot/src/index.js:60:3) {
  generatedMessage: true,
  code: 'ERR_ASSERTION',
  actual: 1204,
  expected: 0,
  operator: '==',
  response: [Object],
  tips: '发送文本信息失败'
}

直接在讯飞调试中心请求是正常的

image
wenzhiquan commented 4 months ago

使用 Kimi 也有同样的问题,有没有可能是网络的原因?

wenzhiquan commented 4 months ago
image

测试是能够通过的

GFigting commented 4 months ago

+1

log2cn commented 4 months ago

我也遇到了这个1204错误, 原因是你不能给自己发消息. 另外"socket 连接关闭"是正常的日志, 不想要的话可以注释掉.