From 20d507dbef94bb676d682d80e00480d0f0064056 Mon Sep 17 00:00:00 2001 From: jack1142 <6032823+jack1142@users.noreply.github.com> Date: Sun, 5 Apr 2020 03:49:02 +0200 Subject: [PATCH] Fix bank check (used in Bank, Economy and Trivia cogs) --- redbot/cogs/bank/bank.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/redbot/cogs/bank/bank.py b/redbot/cogs/bank/bank.py index cc07bc6f7..46e6e70b7 100644 --- a/redbot/cogs/bank/bank.py +++ b/redbot/cogs/bank/bank.py @@ -12,8 +12,9 @@ _ = Translator("Bank", __file__) def is_owner_if_bank_global(): """ Command decorator. If the bank is global, it checks if the author is - bot owner, otherwise it does nothing. - + bot owner, otherwise it only checks + if command was used in guild - it DOES NOT check any permissions. + When used on the command, this should be combined with permissions check like `guildowner_or_permissions()`. """ @@ -21,12 +22,9 @@ def is_owner_if_bank_global(): async def pred(ctx: commands.Context): author = ctx.author if not await bank.is_global(): - if not isinstance(ctx.channel, discord.abc.GuildChannel): + if not ctx.guild: return False - if await ctx.bot.is_owner(author): - return True - permissions = ctx.channel.permissions_for(author) - return author == ctx.guild.owner or permissions.administrator + return True else: return await ctx.bot.is_owner(author)