From b1a1d41d0f11b212b8f5b2f34c2f9fd12fc405bc Mon Sep 17 00:00:00 2001 From: liuwei Date: Wed, 19 Mar 2025 16:45:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=87=E4=BB=A4=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- robot.py | 11 +++++++++++ 1 file changed, 11 insertions(+) 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("/"):