diff --git a/jarvis/__init__.py b/jarvis/__init__.py index da05ec4..0b6530d 100644 --- a/jarvis/__init__.py +++ b/jarvis/__init__.py @@ -25,7 +25,7 @@ intents.members = True restart_ctx = None invites = re.compile( - r"(https?://)?(www.)?(discord.(gg|io|me|li)|discord(app)?.com/invite)/([^\s/]+?)(?=\b)", + r"(?:https?://)?(?:www.)?(?:discord.(?:gg|io|me|li)|discord(?:app)?.com/invite)/([^\s/]+?)(?=\b)", flags=re.IGNORECASE, ) @@ -194,25 +194,14 @@ async def on_message(message: Message): if autopurge: await message.delete(delay=autopurge["delay"]) content = re.sub(r"\s+", "", message.content) -<<<<<<< HEAD - content = re.sub(r"[^\w\d./]+", "", content) match = invites.search(content) if match: -======= - content = re.sub(r"[^\w\s]", "", content) - matches = invites.match(content) - if matches: ->>>>>>> d2cf3549ece5640fd7e215a75e12421c8f19fa10 guild_invites = await message.guild.invites() allowed = [x.code for x in guild_invites] + [ "dbrand", "VtgZntXcnZ", ] -<<<<<<< HEAD - if match.group(6) not in allowed: -======= - if matches.group(6) not in allowed: ->>>>>>> d2cf3549ece5640fd7e215a75e12421c8f19fa10 + if match.group(1) not in allowed: await message.delete() db.jarvis.warns.insert_one( { diff --git a/jarvis/cogs/modlog.py b/jarvis/cogs/modlog.py index 853a927..b89bf1f 100644 --- a/jarvis/cogs/modlog.py +++ b/jarvis/cogs/modlog.py @@ -357,7 +357,7 @@ class ModlogCog(commands.Cog): async def on_message_edit( self, before: discord.Message, after: discord.Message ): - if before.author != self.bot.user.id: + if before.author != get_config().client_id: modlog = self.db.jarvis.settings.find_one( {"guild": after.guild.id, "setting": "modlog"} )