lss233 / chatgpt-mirai-qq-bot

🚀 一键部署!真正的 AI 聊天机器人!支持ChatGPT、文心一言、讯飞星火、Bing、Bard、ChatGLM、POE,多账号,人设调教,虚拟女仆、图片渲染、语音发送 | 支持 QQ、Telegram、Discord、微信 等平台
GNU Affero General Public License v3.0
12.97k stars 1.55k forks source link

[BUG] 使用gocqhttp时机器人不回复群聊消息 #371

Closed Apricityx closed 1 year ago

Apricityx commented 1 year ago

提交 issue 前,请先确认:

表现
私聊能回,bing和ChatGPT都正常,但群聊就不理我,群聊里试过prefix触发和at触发都无效,但使用命令.重新加载配置文件就能正常回复 运行环境:

复现步骤
群聊@机器人不回复

预期行为
正常回复消息

截图
1 私聊中

2 群聊中

lss233 commented 1 year ago

日志?配置文件?

Apricityx commented 1 year ago

后台没报错,直接没动静,配置文件之前用mirai的时候正常回复,应该没什么问题,明天早上发一份上来。这个问题应该能简单的复现。

---原始邮件--- 发件人: "Dark @.> 发送时间: 2023年3月16日(周四) 凌晨0:41 收件人: @.>; 抄送: @.**@.>; 主题: Re: [lss233/chatgpt-mirai-qq-bot] [BUG] 使用gocqhttp时机器人貌似不回复群聊消息 (Issue #371)

日志?配置文件?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

Apricityx commented 1 year ago

日志?配置文件? 配置文件 config.txt

Apricityx commented 1 year ago

日志?配置文件?

启动完后有这么一段报错,但我估摸着和这个问题没关系,配置文件前边发了,应该没有写错。请问现在只有我一个人用gocqhttp出问题吗?我不清楚问题出在哪。 2023-03-17 16:53:32 W/stderr: Exception in thread "DefaultDispatcher-worker-1" java.net.ProtocolException: Expected HTTP 101 response but was '405 ' chatgpt-qq-mirai-1 | 2023-03-17 16:53:32 W/stderr: at mirai-api-http-2.9.1.mirai2.jar[shared]//okhttp3.internal.ws.RealWebSocket.checkUpgradeSuccess$okhttp(RealWebSocket.kt:224) chatgpt-qq-mirai-1 | 2023-03-17 16:53:32 W/stderr: at mirai-api-http-2.9.1.mirai2.jar[shared]//okhttp3.internal.ws.RealWebSocket$connect$1.onResponse(RealWebSocket.kt:170) chatgpt-qq-mirai-1 | 2023-03-17 16:53:32 W/stderr: at mirai-api-http-2.9.1.mirai2.jar[shared]//okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519) chatgpt-qq-mirai-1 | 2023-03-17 16:53:32 W/stderr: at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) chatgpt-qq-mirai-1 | 2023-03-17 16:53:32 W/stderr: at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) chatgpt-qq-mirai-1 | 2023-03-17 16:53:32 W/stderr: at java.base/java.lang.Thread.run(Thread.java:833) chatgpt-qq-mirai-1 | 2023-03-17 16:53:32 W/stderr: Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@25edcd83, Dispatchers.Default]

Apricityx commented 1 year ago

Screenshot_20230318-010733.png

刚问了下,好像不止我一个人遇到了这样的问题。gocqhttp还蛮好用的,劳烦修复下这个问题。

lss233 commented 1 year ago

你提供的那份日志,里面写着 mirai……
我觉得应该不对吧?

Apricityx commented 1 year ago

你提供的那份日志,里面写着 mirai……
我觉得应该不对吧?

正常启动后台会弹mirai吗?我这后台启动的时候会有mirai的消息,但连接的确实是gocqhttp。

我看后台一直跳W/reverse-ws adapter: [reverse-ws] Connection to chatgpt:8554/ interrupted. Trying reconnect in 5000 ms. 我就把onebot的反向连接端口改成8554了,ChatGPT的config也写的8554,是否和这个有关系?

Apricityx commented 1 year ago

docker里mirai没关,我把mirai的配置删了后后台不再弹关于mirai的消息,但是仍旧不回复群聊消息。顺便问下watchertower是用来干什么的,可不可以关掉?

Apricityx commented 1 year ago

concurrentlock:handle_request:40 - [Concurrent] 排队中,前面还有 0 个人!\n","stream":"stdout","time":"2023-03-18T02:52:07.352358132Z"} {"log":"2023-03-18 02:52:07.352 | DEBUG | middlewares.concurrentlock:handle_request:42 - [Concurrent] 排到了!\n","stream":"stdout","time":"2023-03-18T02:52:07.352449263Z"} {"log":"2023-03-18 02:52:07.352 | DEBUG | middlewares.timeout:create_timeout_task:12 - [Timeout] 开始计时……\n","stream":"stdout","time":"2023-03-18T02:52:07.352792417Z"} {"log":"2023-03-18 02:52:07.352 | ERROR | adapter.ms.bing:ask:64 - Cannot write to closing transport\n","stream":"stdout","time":"2023-03-18T02:52:07.366993794Z"} {"log":"Traceback (most recent call last):\n","stream":"stdout","time":"2023-03-18T02:52:07.367019342Z"} {"log":"\n","stream":"stdout","time":"2023-03-18T02:52:07.367023019Z"} {"log":" File \"/app/bot.py\", line 12, in \u003cmodule\u003e\n","stream":"stdout","time":"2023-03-18T02:52:07.367025774Z"} {"log":" import onebot_bot\n","stream":"stdout","time":"2023-03-18T02:52:07.367029331Z"} {"log":"\n","stream":"stdout","time":"2023-03-18T02:52:07.367032226Z"} {"log":" File \"\u003cfrozen importlib._bootstrap\u003e\", line 1178, in _find_and_load\n","stream":"stdout","time":"2023-03-18T02:52:07.367035012Z"} {"log":" File \"\u003cfrozen importlib._bootstrap\u003e\", line 1149, in _find_and_load_unlocked\n","stream":"stdout","time":"2023-03-18T02:52:07.367038228Z"} {"log":" File \"\u003cfrozen importlib._bootstrap\u003e\", line 690, in _load_unlocked\n","stream":"stdout","time":"2023-03-18T02:52:07.367041303Z"} {"log":" File \"\u003cfrozen importlib._bootstrap_external\u003e\", line 940, in exec_module\n","stream":"stdout","time":"2023-03-18T02:52:07.367044339Z"} {"log":" File \"\u003cfrozen importlib._bootstrap\u003e\", line 241, in _call_with_frames_removed\n","stream":"stdout","time":"2023-03-18T02:52:07.367047475Z"} {"log":"\n","stream":"stdout","time":"2023-03-18T02:52:07.367050591Z"} {"log":" File \"/app/onebot_bot.py\", line 184, in \u003cmodule\u003e\n","stream":"stdout","time":"2023-03-18T02:52:07.367053516Z"} {"log":" bot.run(host=config.onebot.reverse_ws_host, port=config.onebot.reverse_ws_port)\n","stream":"stdout","time":"2023-03-18T02:52:07.367056612Z"} {"log":" │ │ │ │ │ │ │ └ 8554\n","stream":"stdout","time":"2023-03-18T02:52:07.367059588Z"} {"log":" │ │ │ │ │ │ └ Onebot(qq=2182528859, manager_qq=3026194904, reverse_ws_host='0.0.0.0', reverse_ws_port=8554)\n","stream":"stdout","time":"2023-03-18T02:52:07.367063154Z"} {"log":" │ │ │ │ │ └ \u003cunprintable Config object\u003e\n","stream":"stdout","time":"2023-03-18T02:52:07.36706647Z"} {"log":" │ │ │ │ └ '0.0.0.0'\n","stream":"stdout","time":"2023-03-18T02:52:07.367069747Z"} {"log":" │ │ │ └ Onebot(qq=2182528859, manager_qq=3026194904, reverse_ws_host='0.0.0.0', reverse_ws_port=8554)\n","stream":"stdout","time":"2023-03-18T02:52:07.367072742Z"} {"log":" │ │ └ \u003cunprintable Config object\u003e\n","stream":"stdout","time":"2023-03-18T02:52:07.367075868Z"} {"log":" │ └ \u003cfunction CQHttp.run at 0x7f7aa704bec0\u003e\n","stream":"stdout","time":"2023-03-18T02:52:07.367078964Z"} {"log":" └ \u003caiocqhttp.CQHttp object at 0x7f7ab41979d0\u003e\n","stream":"stdout","time":"2023-03-18T02:52:07.36708211Z"} {"log":"\n","stream":"stdout","time":"2023-03-18T02:52:07.367085186Z"} {"log":" File \"/usr/local/lib/python3.11/site-packages/aiocqhttp/init.py\", line 222, in run\n","stream":"stdout","time":"2023-03-18T02:52:07.367088051Z"} {"log":" self._server_app.run(host=host, port=port, *args, *kwargs)\n","stream":"stdout","time":"2023-03-18T02:52:07.367091307Z"} {"log":" │ │ │ │ │ │ └ {'use_reloader': False}\n","stream":"stdout","time":"2023-03-18T02:52:07.367094373Z"} {"log":" │ │ │ │ │ └ ()\n","stream":"stdout","time":"2023-03-18T02:52:07.367097669Z"} {"log":" │ │ │ │ └ 8554\n","stream":"stdout","time":"2023-03-18T02:52:07.367100815Z"} {"log":" │ │ │ └ '0.0.0.0'\n","stream":"stdout","time":"2023-03-18T02:52:07.36710375Z"} {"log":" │ │ └ \u003cfunction Quart.run at 0x7f7aa7042480\u003e\n","stream":"stdout","time":"2023-03-18T02:52:07.367106786Z"} {"log":" │ └ \u003cQuart ''\u003e\n","stream":"stdout","time":"2023-03-18T02:52:07.367119871Z"} {"log":" └ \u003caiocqhttp.CQHttp object at 0x7f7ab41979d0\u003e\n","stream":"stdout","time":"2023-03-18T02:52:07.367123367Z"} {"log":" File \"/usr/local/lib/python3.11/site-packages/quart/app.py\", line 1423, in run\n","stream":"stdout","time":"2023-03-18T02:52:07.367126393Z"} {"log":" loop.run_until_complete(asyncio.gather(tasks))\n","stream":"stdout","time":"2023-03-18T02:52:07.367130701Z"} {"log":" │ │

KPotter0413 commented 1 year ago

我有遇到过类似的,我当时是启动顺序导致的问题,先启动这个qq bot然后再打开gocqhttp登录qq解决的

Apricityx commented 1 year ago

好的,我试试,不过已经换mirai了(

---原始邮件--- 发件人: @.> 发送时间: 2023年3月20日(周一) 下午2:55 收件人: @.>; 抄送: @.**@.>; 主题: Re: [lss233/chatgpt-mirai-qq-bot] [BUG] 使用gocqhttp时机器人不回复群聊消息 (Issue #371)

我有遇到过类似的,我当时是启动顺序导致的问题,先启动这个qq bot然后再打开gocqhttp登录qq解决的

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>