From 130ce32cbd7fb30cb0defe50614b46eb0e3a214d Mon Sep 17 00:00:00 2001 From: scragly Date: Sat, 20 Oct 2018 17:36:26 +1000 Subject: Change BYPASS_ROLES check from top_role to all roles. Addresses Issue #72 --- bot/cogs/snekbox.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bot/cogs/snekbox.py b/bot/cogs/snekbox.py index fb9164194..2e52b8d1b 100644 --- a/bot/cogs/snekbox.py +++ b/bot/cogs/snekbox.py @@ -60,10 +60,11 @@ async def channel_is_whitelisted_or_author_can_bypass(ctx: Context): or the channel is a whitelisted channel. """ - if ctx.channel.id not in WHITELISTED_CHANNELS and ctx.author.top_role.id not in BYPASS_ROLES: - raise MissingPermissions("You are not allowed to do that here.") - - return True + if ctx.channel.id in WHITELISTED_CHANNELS: + return True + if any(r.id in BYPASS_ROLES for r in ctx.author.roles): + return True + raise MissingPermissions("You are not allowed to do that here.") class Snekbox: -- cgit v1.2.3