From bda53a9bd9a9b6720089544d45f111ae070c42ec Mon Sep 17 00:00:00 2001 From: liuwei Date: Tue, 13 May 2025 14:29:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8D=E5=93=8D=E5=BA=94=E6=97=B6=E9=97=B4?= =?UTF-8?q?=EF=BC=8C=E9=98=B2=E6=AD=A2=E8=A2=AB=E9=A3=8E=E6=8E=A7?= 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 0b004d7..ee7cdff 100644 --- a/robot.py +++ b/robot.py @@ -467,6 +467,17 @@ class Robot(Job): async def process_plugin_message(self, msg) -> bool: """使用插件处理消息""" # 获取所有消息处理插件 + # TODO 关闭12:30-05:00的系统交互,降低被风控风险。 + # 关闭12:30-05:00的系统交互,降低被风控风险 + current_hour = time.localtime().tm_hour + current_minute = time.localtime().tm_min + is_sleep_time = (current_hour == 0 and current_minute >= 30) or (1 <= current_hour < 5) + + if is_sleep_time: + # 只处理特定消息,如管理员消息或紧急消息 + if from_user != self.wxid and not self._is_admin_message(message): + self.LOG.info(f"夜间休眠时间(00:30-05:00),忽略消息: {message}") + return False message_plugins = self.plugin_registry.get_plugins_by_type(MessagePluginInterface) if not message_plugins: return False