Bug修复

This commit is contained in:
chordfish
2023-03-09 18:29:31 +08:00
parent 357d6aaf75
commit 2cc6a09905
26 changed files with 2340 additions and 88 deletions
+19
View File
@@ -0,0 +1,19 @@
import re
def ignore(msg: str) -> bool:
"""检查消息是否应该被忽略"""
import config
if not hasattr(config, 'ignore_rules'):
return False
if 'prefix' in config.ignore_rules:
for rule in config.ignore_rules['prefix']:
if msg.startswith(rule):
return True
if 'regexp' in config.ignore_rules:
for rule in config.ignore_rules['regexp']:
if re.search(rule, msg):
return True