From 2b176a2853f88679d6dba2df9eba8e525d170edc Mon Sep 17 00:00:00 2001 From: Myned Date: Wed, 8 Nov 2017 22:36:06 -0500 Subject: [PATCH] Added ability for members with manage_messages to end paginators --- src/main/cogs/booru.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/cogs/booru.py b/src/main/cogs/booru.py index 32f96fc..52e537b 100644 --- a/src/main/cogs/booru.py +++ b/src/main/cogs/booru.py @@ -637,7 +637,7 @@ class MsG: @checks.del_ctx() async def pool_paginator(self, ctx, *args): def on_reaction(reaction, user): - if reaction.emoji == '\N{OCTAGONAL SIGN}' and reaction.message.id == ctx.message.id and user is ctx.author: + if reaction.emoji == '\N{OCTAGONAL SIGN}' and reaction.message.id == ctx.message.id and (user is ctx.author or user.permissions_in(reaction.message.channel).manage_messages): raise exc.Abort elif reaction.emoji == '\N{HEAVY BLACK HEART}' and reaction.message.id == paginator.id and user is ctx.author: raise exc.Save @@ -775,7 +775,7 @@ class MsG: @checks.is_nsfw() async def e621_paginator(self, ctx, *args): def on_reaction(reaction, user): - if reaction.emoji == '\N{OCTAGONAL SIGN}' and reaction.message.id == ctx.message.id and user is ctx.author: + if reaction.emoji == '\N{OCTAGONAL SIGN}' and reaction.message.id == ctx.message.id and (user is ctx.author or user.permissions_in(reaction.message.channel).manage_messages): raise exc.Abort elif reaction.emoji == '\N{HEAVY BLACK HEART}' and reaction.message.id == paginator.id and user is ctx.author: raise exc.Save @@ -939,7 +939,7 @@ class MsG: @checks.del_ctx() async def e926_paginator(self, ctx, *args): def on_reaction(reaction, user): - if reaction.emoji == '\N{OCTAGONAL SIGN}' and reaction.message.id == ctx.message.id and user is ctx.author: + if reaction.emoji == '\N{OCTAGONAL SIGN}' and reaction.message.id == ctx.message.id and (user is ctx.author or user.permissions_in(reaction.message.channel).manage_messages): raise exc.Abort elif reaction.emoji == '\N{HEAVY BLACK HEART}' and reaction.message.id == paginator.id and user is ctx.author: raise exc.Save