diff options
| author | 2018-10-20 17:36:26 +1000 | |
|---|---|---|
| committer | 2018-10-20 17:36:26 +1000 | |
| commit | 130ce32cbd7fb30cb0defe50614b46eb0e3a214d (patch) | |
| tree | a4f0b949e69afb17d0e5c4cdb519079f19f47c83 | |
| parent | Wolfram Cog - Merge Request 56, by Chibli (diff) | |
Change BYPASS_ROLES check from top_role to all roles.
Addresses Issue #72
| -rw-r--r-- | bot/cogs/snekbox.py | 9 |
1 files 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: |