Fix redbot.core.utils.common_filters.INVITE_URL_RE regex (#3717)

* Fix invite_url_re

Found that the regex used previously could falsely catch strings such as discord member and discord gggggg which aren't invites and shouldn't be caught, testing with this regex string still catches all invite url variations while allowing these other previously caught strings to keep working

* Update redbot/core/utils/common_filters.py

Co-Authored-By: jack1142 <6032823+jack1142@users.noreply.github.com>

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
This commit is contained in:
kennnyshiwa 2020-04-02 03:11:12 -04:00 committed by GitHub
parent b7a142c21e
commit ffecf1ed15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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