From ced0af2b2936b1fab4f5601bd7b1c00bbbd9130a Mon Sep 17 00:00:00 2001 From: Matteo Bertucci Date: Sat, 30 Jan 2021 15:19:17 +0100 Subject: 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. --- bot/utils/messages.py | 6 ++++-- 1 file 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): -- cgit v1.2.3