diff options
| -rw-r--r-- | bot/cogs/antispam.py | 2 | ||||
| -rw-r--r-- | bot/cogs/reminders.py | 3 | ||||
| -rw-r--r-- | bot/cogs/snekbox.py | 2 | ||||
| -rw-r--r-- | bot/cogs/wolfram.py | 2 | 
4 files changed, 5 insertions, 4 deletions
| diff --git a/bot/cogs/antispam.py b/bot/cogs/antispam.py index a86a6f3d4..9962fe1c2 100644 --- a/bot/cogs/antispam.py +++ b/bot/cogs/antispam.py @@ -56,7 +56,7 @@ class AntiSpam:              or message.guild.id != GuildConfig.id              or message.author.bot              or (message.channel.id in WHITELISTED_CHANNELS and not DEBUG_MODE) -            or (message.author.top_role.id in STAFF_ROLES and not DEBUG_MODE) +            or (any(role.id in STAFF_ROLES for role in message.author.roles) and not DEBUG_MODE)          ):              return diff --git a/bot/cogs/reminders.py b/bot/cogs/reminders.py index 2a9a9d6dc..3f8378426 100644 --- a/bot/cogs/reminders.py +++ b/bot/cogs/reminders.py @@ -14,6 +14,7 @@ from bot.constants import (      POSITIVE_REPLIES, STAFF_ROLES, URLs  )  from bot.pagination import LinePaginator +from bot.utils.checks import with_role_check  from bot.utils.scheduling import Scheduler  from bot.utils.time import humanize_delta, parse_rfc1123, wait_until @@ -188,7 +189,7 @@ class Reminders(Scheduler):          embed = Embed()          # Make sure the reminder should actually be made. -        if ctx.author.top_role.id not in STAFF_ROLES: +        if with_role_check(ctx, *STAFF_ROLES):              # If they don't have permission to set a reminder in this channel              if ctx.channel.id not in WHITELISTED_CHANNELS: diff --git a/bot/cogs/snekbox.py b/bot/cogs/snekbox.py index 1cef3986d..cc18c0041 100644 --- a/bot/cogs/snekbox.py +++ b/bot/cogs/snekbox.py @@ -104,7 +104,7 @@ class Snekbox:          try:              stripped_lines = [ln.strip() for ln in code.split('\n')] -            if all([line.startswith('#') for line in stripped_lines]): +            if all(line.startswith('#') for line in stripped_lines):                  return await ctx.send(                      f"{ctx.author.mention} Your eval job has completed.\n\n```[No output]```"                  ) diff --git a/bot/cogs/wolfram.py b/bot/cogs/wolfram.py index f16c28dde..e8b16b243 100644 --- a/bot/cogs/wolfram.py +++ b/bot/cogs/wolfram.py @@ -74,7 +74,7 @@ def custom_cooldown(*ignore: List[int]) -> check:      async def predicate(ctx: Context) -> bool:          user_bucket = usercd.get_bucket(ctx.message) -        if ctx.author.top_role.id not in ignore: +        if all(role.id not in ignore for role in ctx.author.roles):              user_rate = user_bucket.update_rate_limit()              if user_rate: | 
