Merge pull request #1239 from magisk317/dev

Fix TypeError in _check_ban_regex by handling NoneType raw_message
pull/1240/head
SengokuCola 2025-09-17 12:19:16 +08:00 committed by GitHub
commit b6dfc68675
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -58,6 +58,10 @@ def _check_ban_regex(text: str, chat: ChatStream, userinfo: UserInfo) -> bool:
Returns:
bool: 是否匹配过滤正则
"""
# 检查text是否为None或空字符串
if text is None or not text:
return False
for pattern in global_config.message_receive.ban_msgs_regex:
if re.search(pattern, text):
chat_name = chat.group_info.group_name if chat.group_info else "私聊"