diff options
| author | 2021-01-30 15:19:17 +0100 | |
|---|---|---|
| committer | 2021-01-30 15:19:17 +0100 | |
| commit | ced0af2b2936b1fab4f5601bd7b1c00bbbd9130a (patch) | |
| tree | 71da376351e34d2326e9a91606370cc11e10227c | |
| parent | Merge PR #1388 - gracefully handle non-existing infractions (diff) | |
Make sure that restrictions also applies to moderators
Without this, if a moderator add a reaction to any message, all the messages currently listening for reaction will pass the check since the user has a moderation role.
| -rw-r--r-- | bot/utils/messages.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/bot/utils/messages.py b/bot/utils/messages.py index 832ad4d55..077dd9569 100644 --- a/bot/utils/messages.py +++ b/bot/utils/messages.py @@ -48,8 +48,10 @@ async def wait_for_deletion( return ( reaction.message.id == message.id and str(reaction.emoji) in deletion_emojis - and user.id in user_ids - or allow_moderation_roles and any(role.id in MODERATION_ROLES for role in user.roles) + and ( + user.id in user_ids + or allow_moderation_roles and any(role.id in MODERATION_ROLES for role in user.roles) + ) ) with contextlib.suppress(asyncio.TimeoutError): |