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()