diff --git a/src/plugins/chat/bot.py b/src/plugins/chat/bot.py index 490003c8f..80d620722 100644 --- a/src/plugins/chat/bot.py +++ b/src/plugins/chat/bot.py @@ -148,7 +148,7 @@ class ChatBot: response = None # 开始组织语言 - if random() < reply_probability: + if random() < reply_probability + 1: bot_user_info = UserInfo( user_id=global_config.BOT_QQ, user_nickname=global_config.BOT_NICKNAME, @@ -183,8 +183,10 @@ class ChatBot: chat_talking_prompt = get_recent_group_detailed_plain_text( stream_id, limit=global_config.MAX_CONTEXT_SIZE, combine=True ) - - await subheartflow_manager.get_subheartflow(stream_id).do_after_reply(response, chat_talking_prompt) + if subheartflow_manager.get_subheartflow(stream_id): + await subheartflow_manager.get_subheartflow(stream_id).do_after_reply(response, chat_talking_prompt) + else: + await subheartflow_manager.create_subheartflow(stream_id).do_after_reply(response, chat_talking_prompt) # print(f"有response: {response}") container = message_manager.get_container(chat.stream_id) thinking_message = None diff --git a/src/plugins/chat/relationship_manager.py b/src/plugins/chat/relationship_manager.py index 65e19d535..9221817c3 100644 --- a/src/plugins/chat/relationship_manager.py +++ b/src/plugins/chat/relationship_manager.py @@ -170,7 +170,7 @@ class RelationshipManager: if key in self.relationships: return self.relationships[key] else: - return 0 + return None async def load_relationship(self, data: dict) -> Relationship: """从数据库加载或创建新的关系对象"""