diff options
author | 2024-03-28 15:30:57 +0400 | |
---|---|---|
committer | 2024-03-28 15:30:57 +0400 | |
commit | 69bc65b19150039108a1619e243d9aaea9a04a0b (patch) | |
tree | 6aaf80339f6e01f0f0284c7a66b32f87dee536b4 | |
parent | Skip adding phishing button if user already banned (diff) |
Use regex to detect Discord invite link
-rw-r--r-- | bot/exts/filtering/_ui/ui.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bot/exts/filtering/_ui/ui.py b/bot/exts/filtering/_ui/ui.py index 49f4614c7..e6c39dc75 100644 --- a/bot/exts/filtering/_ui/ui.py +++ b/bot/exts/filtering/_ui/ui.py @@ -16,6 +16,7 @@ from pydis_core.site_api import ResponseCodeError from pydis_core.utils import scheduling from pydis_core.utils.logging import get_logger from pydis_core.utils.members import get_or_fetch_member +from pydis_core.utils.regex import DISCORD_INVITE import bot from bot.constants import Colours @@ -685,7 +686,7 @@ class AlertView(discord.ui.View): return "", None if content_list: current_content = next(iter(content_list)) - if filter_list.name == "domain" and "discord.gg" in current_content: + if filter_list.name == "domain" and re.fullmatch(DISCORD_INVITE, current_content): # Leave invites to the invite filterlist. continue if encountered: |