不响应时间,防止被风控
This commit is contained in:
5
robot.py
5
robot.py
@@ -467,7 +467,7 @@ class Robot(Job):
|
|||||||
async def process_plugin_message(self, msg) -> bool:
|
async def process_plugin_message(self, msg) -> bool:
|
||||||
"""使用插件处理消息"""
|
"""使用插件处理消息"""
|
||||||
# 获取所有消息处理插件
|
# 获取所有消息处理插件
|
||||||
# TODO 关闭12:30-05:00的系统交互,降低被风控风险。
|
|
||||||
# 关闭12:30-05:00的系统交互,降低被风控风险
|
# 关闭12:30-05:00的系统交互,降低被风控风险
|
||||||
current_hour = time.localtime().tm_hour
|
current_hour = time.localtime().tm_hour
|
||||||
current_minute = time.localtime().tm_min
|
current_minute = time.localtime().tm_min
|
||||||
@@ -475,8 +475,7 @@ class Robot(Job):
|
|||||||
|
|
||||||
if is_sleep_time:
|
if is_sleep_time:
|
||||||
# 只处理特定消息,如管理员消息或紧急消息
|
# 只处理特定消息,如管理员消息或紧急消息
|
||||||
if from_user != self.wxid and not self._is_admin_message(message):
|
self.LOG.info(f"夜间休眠时间(00:30-05:00),忽略消息: {msg}")
|
||||||
self.LOG.info(f"夜间休眠时间(00:30-05:00),忽略消息: {message}")
|
|
||||||
return False
|
return False
|
||||||
message_plugins = self.plugin_registry.get_plugins_by_type(MessagePluginInterface)
|
message_plugins = self.plugin_registry.get_plugins_by_type(MessagePluginInterface)
|
||||||
if not message_plugins:
|
if not message_plugins:
|
||||||
|
|||||||
Reference in New Issue
Block a user