🤖 自动格式化代码 [skip ci]

This commit is contained in:
github-actions[bot]
2025-06-23 18:16:23 +00:00
parent e7379ebc84
commit f1763f7e96
2 changed files with 7 additions and 9 deletions

View File

@@ -53,10 +53,10 @@ class NoReplyAction(BaseAction):
# 跳过LLM判断的配置 # 跳过LLM判断的配置
_skip_judge_when_tired = True _skip_judge_when_tired = True
_skip_probability = 0.5 _skip_probability = 0.5
# 新增:回复频率退出专注模式的配置 # 新增:回复频率退出专注模式的配置
_frequency_check_window = 600 # 频率检查窗口时间(秒) _frequency_check_window = 600 # 频率检查窗口时间(秒)
# 动作参数定义 # 动作参数定义
action_parameters = {"reason": "不回复的原因"} action_parameters = {"reason": "不回复的原因"}
@@ -388,10 +388,10 @@ class NoReplyAction(BaseAction):
async def _check_frequency_and_exit_focus(self, current_time: float) -> bool: async def _check_frequency_and_exit_focus(self, current_time: float) -> bool:
"""检查回复频率,决定是否退出专注模式 """检查回复频率,决定是否退出专注模式
Args: Args:
current_time: 当前时间戳 current_time: 当前时间戳
Returns: Returns:
bool: 是否应该退出专注模式 bool: 是否应该退出专注模式
""" """
@@ -399,7 +399,7 @@ class NoReplyAction(BaseAction):
# 只在auto模式下进行频率检查 # 只在auto模式下进行频率检查
if global_config.chat.chat_mode != "auto": if global_config.chat.chat_mode != "auto":
return False return False
# 获取检查窗口内的所有消息 # 获取检查窗口内的所有消息
window_start_time = current_time - self._frequency_check_window window_start_time = current_time - self._frequency_check_window
all_messages = message_api.get_messages_by_time_in_chat( all_messages = message_api.get_messages_by_time_in_chat(
@@ -507,4 +507,4 @@ class NoReplyAction(BaseAction):
def reset_consecutive_count(cls): def reset_consecutive_count(cls):
"""重置连续计数器""" """重置连续计数器"""
cls._consecutive_count = 0 cls._consecutive_count = 0
logger.debug("NoReplyAction连续计数器已重置") logger.debug("NoReplyAction连续计数器已重置")

View File

@@ -109,8 +109,6 @@ class ReplyAction(BaseAction):
return False, f"回复失败: {str(e)}" return False, f"回复失败: {str(e)}"
class EmojiAction(BaseAction): class EmojiAction(BaseAction):
"""表情动作 - 发送表情包""" """表情动作 - 发送表情包"""