mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-20 18:06:08 -05:00
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user