diff options
| author | 2018-10-20 18:08:28 +0000 | |
|---|---|---|
| committer | 2018-10-20 18:08:28 +0000 | |
| commit | b8de191483ac0e4058d189989acd73c2b239c0a3 (patch) | |
| tree | a4f0b949e69afb17d0e5c4cdb519079f19f47c83 | |
| parent | Wolfram Cog - Merge Request 56, by Chibli (diff) | |
| parent | Change BYPASS_ROLES check from top_role to all roles. (diff) | |
Merge branch 'eval-role-bypass-fix' into 'master'
Change BYPASS_ROLES check from top_role to all roles.
See merge request python-discord/projects/bot!78
| -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: |