From f8019925a624be113c58a090b230a24e1a92ae40 Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Sat, 23 Nov 2024 21:11:58 +0000 Subject: Ensure we don't match to non-invite looking links --- pydis_core/utils/regex.py | 4 ++-- 1 file 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 -- cgit v1.2.3