diff --git a/cogs/logs.py b/cogs/logs.py index 6642ce6..bc74852 100644 --- a/cogs/logs.py +++ b/cogs/logs.py @@ -4,6 +4,7 @@ import json import re import config from helpers.restrictions import get_user_restrictions +from helpers.checks import check_if_staff class Logs(Cog): @@ -141,6 +142,9 @@ class Logs(Cog): if message.author.bot: return + if check_if_staff(message): + return + alert = False cleancont = self.clean_re.sub('', message.content).lower() msg = f"🚨 Suspicious message by {message.author.mention} "\ diff --git a/helpers/checks.py b/helpers/checks.py index 5b0353f..417eb1e 100644 --- a/helpers/checks.py +++ b/helpers/checks.py @@ -1,5 +1,6 @@ import config + def check_if_staff(ctx): if not ctx.guild: return False @@ -20,10 +21,11 @@ def check_if_staff_or_ot(ctx): is_staff = any(r.id in config.staff_role_ids for r in ctx.author.roles) return (is_ot or is_staff or is_bot_cmds) + def check_if_collaborator(ctx): - return any(r.id in config.staff_role_ids + config.allowed_pin_roles for r in ctx.author.roles) + return any(r.id in config.staff_role_ids + config.allowed_pin_roles + for r in ctx.author.roles) def check_if_pin_channel(ctx): return ctx.message.channel.id in config.allowed_pin_channels -