在bot.py中添加实现必然回复判断的代码

pull/588/head
Bakadax 2025-03-26 21:36:12 +08:00
parent e1b81a1316
commit d07d09f558
1 changed files with 17 additions and 9 deletions

View File

@ -135,7 +135,15 @@ class ChatBot:
await self.storage.store_message(message, chat, topic[0] if topic else None) await self.storage.store_message(message, chat, topic[0] if topic else None)
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) 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( reply_probability = await willing_manager.change_reply_willing_received(
chat_stream=chat, chat_stream=chat,
is_mentioned_bot=is_mentioned, is_mentioned_bot=is_mentioned,