better:可通过配置文件自定义 运行处理器

This commit is contained in:
SengokuCola
2025-05-20 23:34:33 +08:00
parent b41b7b6524
commit de2736fccd
7 changed files with 88 additions and 25 deletions

View File

@@ -111,7 +111,7 @@ def _check_ban_words(text: str, chat, userinfo) -> bool:
Returns:
bool: 是否包含过滤词
"""
for word in global_config.chat.ban_words:
for word in global_config.message_receive.ban_words:
if word in text:
chat_name = chat.group_info.group_name if chat.group_info else "私聊"
logger.info(f"[{chat_name}]{userinfo.user_nickname}:{text}")
@@ -131,7 +131,7 @@ def _check_ban_regex(text: str, chat, userinfo) -> bool:
Returns:
bool: 是否匹配过滤正则
"""
for pattern in global_config.chat.ban_msgs_regex:
for pattern in global_config.message_receive.ban_msgs_regex:
if pattern.search(text):
chat_name = chat.group_info.group_name if chat.group_info else "私聊"
logger.info(f"[{chat_name}]{userinfo.user_nickname}:{text}")