mirror of https://github.com/Mai-with-u/MaiBot.git
Merge pull request #1239 from magisk317/dev
Fix TypeError in _check_ban_regex by handling NoneType raw_messagepull/1240/head
commit
b6dfc68675
|
|
@ -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 "私聊"
|
||||
|
|
|
|||
Loading…
Reference in New Issue