diff --git a/robot.py b/robot.py index 9f36842..b19c689 100644 --- a/robot.py +++ b/robot.py @@ -283,6 +283,17 @@ class Robot(Job): except Exception as e: self.LOG.error(f"archive_message error: {e}") + # 记录在群里发的最新消息,可以通过撤回指令撤回 + try: + if msg.from_self(): + rsp = self.gbm.handle_command(msg.roomid, msg.content) + # 不在群里发送,防止被骚扰 + if rsp is not None: + self.send_text_msg(rsp, msg.sender) + return + except Exception as e: + self.LOG.error(f"revoke_receive_message error: {e}") + # 兼容不@ 直接/触发指令,回答问题。 try: if msg.content.startswith("/"):