修改配置名与修改过滤对象为raw_message

This commit is contained in:
ChangingSelf
2025-03-11 00:12:19 +08:00
parent 1b611ecce5
commit 204744cd71
3 changed files with 6 additions and 6 deletions

View File

@@ -77,10 +77,10 @@ class ChatBot:
return
# 正则表达式过滤
for pattern in global_config.ban_words_regex:
for pattern in global_config.ban_msgs_regex:
if re.search(pattern, message.detailed_plain_text):
logger.info(
f"[{message.group_name}]{message.user_nickname}:{message.processed_plain_text}")
f"[{message.group_name}]{message.user_nickname}:{message.raw_message}")
logger.info(f"[正则表达式过滤]消息匹配到{pattern}filtered")
return

View File

@@ -43,7 +43,7 @@ class BotConfig:
EMOJI_CHECK_PROMPT: str = "符合公序良俗" # 表情包过滤要求
ban_words = set()
ban_words_regex = set()
ban_msgs_regex = set()
max_response_length: int = 1024 # 最大回复长度
@@ -280,7 +280,7 @@ class BotConfig:
config.down_frequency_rate = msg_config.get("down_frequency_rate", config.down_frequency_rate)
if config.INNER_VERSION in SpecifierSet(">=0.0.5"):
config.ban_words_regex = msg_config.get("ban_words_regex", config.ban_words_regex)
config.ban_msgs_regex = msg_config.get("ban_msgs_regex", config.ban_msgs_regex)
def memory(parent: dict):
memory_config = parent["memory"]