From d07d09f558886b91d5e29595882fe76fbf6fc5f9 Mon Sep 17 00:00:00 2001 From: Bakadax Date: Wed, 26 Mar 2025 21:36:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8bot.py=E4=B8=AD=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E5=BF=85=E7=84=B6=E5=9B=9E=E5=A4=8D=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugins/chat/bot.py | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/plugins/chat/bot.py b/src/plugins/chat/bot.py index e8937521..a93e3f3f 100644 --- a/src/plugins/chat/bot.py +++ b/src/plugins/chat/bot.py @@ -135,15 +135,23 @@ class ChatBot: await self.storage.store_message(message, chat, topic[0] if topic else None) - is_mentioned = is_mentioned_bot_in_message(message) - reply_probability = await willing_manager.change_reply_willing_received( - chat_stream=chat, - is_mentioned_bot=is_mentioned, - config=global_config, - is_emoji=message.is_emoji, - interested_rate=interested_rate, - sender_id=str(message.message_info.user_info.user_id), - ) + if (f"[CQ:at,qq={global_config.BOT_QQ}" in message_cq.raw_message) and global_config.at_bot_inevitable_reply: + reply_probability = 1 + logger.info("被@,回复概率设置为100%") + else: + is_mentioned = is_mentioned_bot_in_message(message) + if is_mentioned and global_config.metioned_bot_inevitable_reply: + reply_probability = 1 + logger.info("被提及,回复概率设置为100%") + else: + reply_probability = await willing_manager.change_reply_willing_received( + chat_stream=chat, + is_mentioned_bot=is_mentioned, + config=global_config, + is_emoji=message.is_emoji, + interested_rate=interested_rate, + sender_id=str(message.message_info.user_info.user_id), + ) if global_config.enable_think_flow: current_willing_old = willing_manager.get_willing(chat_stream=chat)