diff options
author | 2024-11-23 20:51:21 +0000 | |
---|---|---|
committer | 2024-11-23 20:51:21 +0000 | |
commit | 21a32dead189ac6aab883484247e69bcdcd5d11f (patch) | |
tree | 34bb67a310d27a4f008a0a8a456c03f583be1fa9 | |
parent | Remove deprecated ruff rules (diff) |
Update filter regex to not be overly strict
Co-authored-by: bj0key <[email protected]>
-rw-r--r-- | pydis_core/utils/regex.py | 6 |
1 files 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<invite>\S+)", # the invite code itself flags=re.IGNORECASE |