pr#588
This commit is contained in:
@@ -186,7 +186,23 @@ class ReasoningChat:
|
||||
logger.info("触发缓冲,已炸飞消息列")
|
||||
return
|
||||
|
||||
is_mentioned = is_mentioned_bot_in_message(message)
|
||||
# 处理提及
|
||||
reply_probability = 0
|
||||
is_at = False
|
||||
is_mentioned = False
|
||||
if f"@{global_config.BOT_NICKNAME}({global_config.BOT_QQ})" in message.processed_plain_text:
|
||||
is_at = True
|
||||
is_mentioned = True
|
||||
|
||||
if is_at and global_config.at_bot_inevitable_reply:
|
||||
reply_probability = 1
|
||||
logger.info("被@,回复概率设置为100%")
|
||||
else:
|
||||
if not is_mentioned:
|
||||
is_mentioned = is_mentioned_bot_in_message(message)
|
||||
if is_mentioned and global_config.metioned_bot_inevitable_reply:
|
||||
reply_probability = 1
|
||||
logger.info("被提及,回复概率设置为100%")
|
||||
|
||||
# 计算回复意愿
|
||||
current_willing = willing_manager.get_willing(chat_stream=chat)
|
||||
@@ -194,7 +210,7 @@ class ReasoningChat:
|
||||
|
||||
# 意愿激活
|
||||
timer1 = time.time()
|
||||
reply_probability = await willing_manager.change_reply_willing_received(
|
||||
real_reply_probability = await willing_manager.change_reply_willing_received(
|
||||
chat_stream=chat,
|
||||
is_mentioned_bot=is_mentioned,
|
||||
config=global_config,
|
||||
@@ -202,6 +218,8 @@ class ReasoningChat:
|
||||
interested_rate=interested_rate,
|
||||
sender_id=str(message.message_info.user_info.user_id),
|
||||
)
|
||||
if reply_probability != 1 or (groupinfo and (groupinfo.group_id not in global_config.talk_allowed_groups)):
|
||||
reply_probability = real_reply_probability
|
||||
timer2 = time.time()
|
||||
timing_results["意愿激活"] = timer2 - timer1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user