From 09a2e63095bea8816bbac29851afe14bb1bed05a Mon Sep 17 00:00:00 2001 From: SengokuCola <1026294844@qq.com> Date: Wed, 30 Apr 2025 18:37:09 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E5=B0=8Fbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugins/heartFC_chat/heartflow_prompt_builder.py | 4 ++-- src/plugins/willing/mode_classical.py | 3 +++ src/plugins/willing/willing_manager.py | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/plugins/heartFC_chat/heartflow_prompt_builder.py b/src/plugins/heartFC_chat/heartflow_prompt_builder.py index c23d6a7e2..69bae0411 100644 --- a/src/plugins/heartFC_chat/heartflow_prompt_builder.py +++ b/src/plugins/heartFC_chat/heartflow_prompt_builder.py @@ -263,9 +263,9 @@ class PromptBuilder: relation_prompt = "" for person in who_chat_in_group: relation_prompt += await relationship_manager.build_relationship_info(person) - print(f"relation_prompt: {relation_prompt}") + # print(f"relation_prompt: {relation_prompt}") - print(f"relat11111111ion_prompt: {relation_prompt}") + # print(f"relat11111111ion_prompt: {relation_prompt}") # 心情 mood_manager = MoodManager.get_instance() diff --git a/src/plugins/willing/mode_classical.py b/src/plugins/willing/mode_classical.py index 8ee88d66f..e96aa77a7 100644 --- a/src/plugins/willing/mode_classical.py +++ b/src/plugins/willing/mode_classical.py @@ -64,6 +64,9 @@ class ClassicalWillingManager(BaseWillingManager): self.chat_reply_willing[chat_id] = max(0, current_willing - 1.8) async def after_generate_reply_handle(self, message_id): + if message_id not in self.ongoing_messages: + return + chat_id = self.ongoing_messages[message_id].chat_id current_willing = self.chat_reply_willing.get(chat_id, 0) if current_willing < 1: diff --git a/src/plugins/willing/willing_manager.py b/src/plugins/willing/willing_manager.py index 78c86e258..c26325b1c 100644 --- a/src/plugins/willing/willing_manager.py +++ b/src/plugins/willing/willing_manager.py @@ -110,7 +110,7 @@ class BaseWillingManager(ABC): def delete(self, message_id: str): del_message = self.ongoing_messages.pop(message_id, None) if not del_message: - logger.debug(f"删除异常,当前消息{message_id}不存在") + logger.debug(f"尝试删除不存在的消息 ID: {message_id},可能已被其他流程处理,喵~") @abstractmethod async def async_task_starter(self) -> None: