aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2024-11-23 21:11:58 +0000
committerGravatar Chris Lovering <[email protected]>2024-11-23 21:18:35 +0000
commitf8019925a624be113c58a090b230a24e1a92ae40 (patch)
tree81c0b2b2ce5b428fd14e4821ef3908a2bd018d49
parentEscape backslashes in invite regex (diff)
Ensure we don't match to non-invite looking links
-rw-r--r--pydis_core/utils/regex.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pydis_core/utils/regex.py b/pydis_core/utils/regex.py
index 8726020d..88a4c52f 100644
--- a/pydis_core/utils/regex.py
+++ b/pydis_core/utils/regex.py
@@ -3,8 +3,8 @@
import re
DISCORD_INVITE = re.compile(
- r"(https?:\/\/)?(www\.)?" # Optional http(s) and www.
- r"(discord(app)?)?" # Optional discord(app)
+ r"(https?:\/\/)?(www\.)?" # Optional http(s) and www.
+ r"(\B|discord(app)?)" # Optional discord(app)
r"([.,]|dot)" # Various characters to cover dots
r"("
r"(gg|me)" # TLDs that embed within discord