From 20fc630d7832e5caee3cfb134c2561a1a99fff59 Mon Sep 17 00:00:00 2001 From: liuwei Date: Mon, 17 Feb 2025 14:28:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=A7=A6=E5=8F=91=E5=9C=BA?= =?UTF-8?q?=E6=99=AF=EF=BC=8C=E6=9C=BA=E5=99=A8=E4=BA=BA=E7=AE=A1=E7=90=86?= =?UTF-8?q?=EF=BC=8C=E5=8F=AA=E9=9C=80=E8=A6=81=E5=8F=91=E9=80=81=E6=8C=87?= =?UTF-8?q?=E4=BB=A4=E5=8D=B3=E5=8F=AF=EF=BC=8C=E4=B8=8D=E8=83=BD=E8=87=AA?= =?UTF-8?q?=E5=B7=B1@=E8=87=AA=E5=B7=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- robot.py | 8 +++----- robot_cmd/robot_command.py | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/robot.py b/robot.py index fc08ff6..810b6c2 100644 --- a/robot.py +++ b/robot.py @@ -139,11 +139,6 @@ class Robot(Job): if q == '撤回': self.revoke_messages(msg.roomid) return True - # 如果聊天内容来自自己,则进行指令判断 - if msg.from_self() and msg.from_group(): - rsp = GroupBotManager.handle_command(msg.roomid, q) - self.sendTextMsg(rsp, msg.roomid, msg.sender) - return True if not self.chat: # 没接 ChatGPT,固定回复 rsp = "你@我干嘛?" else: # 接了 ChatGPT,智能回复 @@ -198,6 +193,9 @@ class Robot(Job): # 记录在群里发的最新消息,可以通过撤回指令撤回 if msg.from_self(): self.revoke_receive_message(msg) + rsp = GroupBotManager.handle_command(msg.roomid, msg.content) + self.sendTextMsg(rsp, msg.roomid, msg.sender) + return # 如果在群里被 @ if msg.roomid not in self.config.GROUPS: # 不在配置的响应的群列表里,忽略 diff --git a/robot_cmd/robot_command.py b/robot_cmd/robot_command.py index faa2ba5..95337a0 100644 --- a/robot_cmd/robot_command.py +++ b/robot_cmd/robot_command.py @@ -247,4 +247,4 @@ def simulate_commands(): # 执行模拟命令 -simulate_commands() +# simulate_commands()