diff --git a/src/chat/utils/utils.py b/src/chat/utils/utils.py index 2bb8da60..23ebe64e 100644 --- a/src/chat/utils/utils.py +++ b/src/chat/utils/utils.py @@ -64,7 +64,7 @@ def is_mentioned_bot_in_message(message: MessageRecv) -> tuple[bool, float]: ) # 判断是否被@ - if re.search(f"@[\s\S]*?(id:{global_config.BOT_QQ})", message.processed_plain_text): + if re.search(f"@[\\s\\S]*?(id:{global_config.BOT_QQ})", message.processed_plain_text): is_at = True is_mentioned = True @@ -75,7 +75,7 @@ def is_mentioned_bot_in_message(message: MessageRecv) -> tuple[bool, float]: if not is_mentioned: # 判断是否被回复 if re.match( - f"\[回复 [\s\S]*?\({str(global_config.BOT_QQ)}\):[\s\S]*?],说:", message.processed_plain_text + f"\\[回复 [\\s\\S]*?\\({str(global_config.BOT_QQ)}\\):[\\s\\S]*?\\],说:", message.processed_plain_text ): is_mentioned = True else: