From 21a32dead189ac6aab883484247e69bcdcd5d11f Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Sat, 23 Nov 2024 20:51:21 +0000 Subject: Update filter regex to not be overly strict Co-authored-by: bj0key <95365351+bj0key@users.noreply.github.com> --- pydis_core/utils/regex.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pydis_core/utils/regex.py b/pydis_core/utils/regex.py index a78f2afb..fa7caecf 100644 --- a/pydis_core/utils/regex.py +++ b/pydis_core/utils/regex.py @@ -6,8 +6,10 @@ DISCORD_INVITE = re.compile( r"(https?://)?(www\.)?" # Optional http(s) and www. r"(discord(app)?)?" # Optional discord(app) r"([.,]|dot)" # Various characters to cover dots - r"(gg|com|me|li|io)" # A few TLDs that embed within discord - r"((/|slash|\\)(invite))?" # / or \ or 'slash' invite + r"(" + r"(gg|me|li|io)" # A few TLDs that embed within discord + r"|com(\/|slash|\\)invite" # Only match com/invite + r")" r"(/|slash|\\)" # / or \ or 'slash' r"(?P\S+)", # the invite code itself flags=re.IGNORECASE -- cgit v1.2.3