This commit is contained in:
墨梓柒
2025-09-28 00:02:18 +08:00
parent 5cc1e56904
commit e9a5488b62
32 changed files with 215 additions and 222 deletions

View File

@@ -206,7 +206,11 @@ class HeartFChatting:
# *控制频率用
if mentioned_message:
await self._observe(recent_messages_list=recent_messages_list, force_reply_message=mentioned_message)
elif random.random() < global_config.chat.talk_value * frequency_control_manager.get_or_create_frequency_control(self.stream_id).get_talk_frequency_adjust():
elif (
random.random()
< global_config.chat.talk_value
* frequency_control_manager.get_or_create_frequency_control(self.stream_id).get_talk_frequency_adjust()
):
await self._observe(recent_messages_list=recent_messages_list)
else:
# 没有提到继续保持沉默等待5秒防止频繁触发
@@ -276,9 +280,8 @@ class HeartFChatting:
recent_messages_list = []
reply_text = "" # 初始化reply_text变量避免UnboundLocalError
start_time = time.time()
if s4u_config.enable_s4u:
await send_typing()
@@ -350,7 +353,7 @@ class HeartFChatting:
available_actions=available_actions,
)
)
logger.info(
f"{self.log_prefix} 决定执行{len(action_to_use_info)}个动作: {' '.join([a.action_type for a in action_to_use_info])}"
)
@@ -412,7 +415,7 @@ class HeartFChatting:
},
}
reply_text = action_reply_text
self.end_cycle(loop_info, cycle_timers)
self.print_cycle_info(cycle_timers)
@@ -423,11 +426,6 @@ class HeartFChatting:
else:
await asyncio.sleep(0.1)
"""S4U内容暂时保留"""
if s4u_config.enable_s4u:
await stop_typing()