diff --git a/discord_rss_bot/blacklist.py b/discord_rss_bot/blacklist.py index e4bfa13..0f1aad5 100644 --- a/discord_rss_bot/blacklist.py +++ b/discord_rss_bot/blacklist.py @@ -19,8 +19,7 @@ def is_word_in_text(words: str, text: str) -> bool: for word in word_list: look_for: str = rf"(^|[^\w]){word}([^\w]|$)" pattern: re.Pattern[str] = re.compile(look_for, re.IGNORECASE) - matches: re.Match[str] | None = re.search(pattern, text) - if matches: + if re.search(pattern, text): return True return False diff --git a/discord_rss_bot/whitelist.py b/discord_rss_bot/whitelist.py index 7024053..f4153d9 100644 --- a/discord_rss_bot/whitelist.py +++ b/discord_rss_bot/whitelist.py @@ -19,8 +19,7 @@ def is_word_in_text(words: str, text: str) -> bool: for word in word_list: look_for: str = rf"(^|[^\w]){word}([^\w]|$)" pattern: re.Pattern[str] = re.compile(look_for, re.IGNORECASE) - matches: re.Match[str] | None = re.search(pattern, text) - if matches: + if re.search(pattern, text): return True return False