From 83e49c25d0cdd473ddf2d5feb4aa85d041ed596b Mon Sep 17 00:00:00 2001 From: Jeremiah Boby Date: Sun, 13 Oct 2019 18:03:07 +0100 Subject: Check partially hidden words against the wordlist --- bot/cogs/filtering.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bot/cogs/filtering.py b/bot/cogs/filtering.py index 265ae5160..875276d8a 100644 --- a/bot/cogs/filtering.py +++ b/bot/cogs/filtering.py @@ -26,6 +26,7 @@ INVITE_RE = re.compile( flags=re.IGNORECASE ) +SPOILER_RE = re.compile(r"(\|\|.+?\|\|)") URL_RE = re.compile(r"(https?://[^\s]+)", flags=re.IGNORECASE) ZALGO_RE = re.compile(r"[\u0300-\u036F\u0489]") @@ -237,7 +238,7 @@ class Filtering(Cog): Only matches words with boundaries before and after the expression. """ for regex_pattern in WORD_WATCHLIST_PATTERNS: - if regex_pattern.search(text): + if regex_pattern.search(text + SPOILER_RE.sub('', text)): return True return False -- cgit v1.2.3