Add discord.com to supported domains in INVITE_URL_RE (#4012)

* Support for discord.com

* Modified to support discord.com requiring `/invite`

* Non-capturing
This commit is contained in:
bobloy 2020-06-24 14:06:11 -04:00 committed by GitHub
parent a96e814af4
commit 632840384b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,7 +16,7 @@ __all__ = [
# regexes # regexes
URL_RE = re.compile(r"(https?|s?ftp)://(\S+)", re.I) URL_RE = re.compile(r"(https?|s?ftp)://(\S+)", re.I)
INVITE_URL_RE = re.compile(r"(discord\.(?:gg|io|me|li)|discordapp\.com\/invite)\/(\S+)", re.I) INVITE_URL_RE = re.compile(r"(discord\.(?:gg|io|me|li)|discord(?:app)?\.com\/invite)\/(\S+)", re.I)
MASS_MENTION_RE = re.compile(r"(@)(?=everyone|here)") # This only matches the @ for sanitizing MASS_MENTION_RE = re.compile(r"(@)(?=everyone|here)") # This only matches the @ for sanitizing