From 757b49a3eb61baf868e29ead938f458e9168f24b Mon Sep 17 00:00:00 2001 From: phxntxm Date: Sun, 23 Sep 2018 18:02:19 -0500 Subject: [PATCH] Change how ownership dict is read --- cogs/utils/checks.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cogs/utils/checks.py b/cogs/utils/checks.py index f7993d3..6dfa1ea 100644 --- a/cogs/utils/checks.py +++ b/cogs/utils/checks.py @@ -159,6 +159,8 @@ def has_perms(ctx, **perms): # Return true if this is a private channel, we'll handle that in the registering of the command if type(ctx.message.channel) is discord.DMChannel: return True + # Just get rid of this if it exists + perms.pop("ownership", None) # Get the member permissions so that we can compare guild_perms = ctx.message.author.guild_permissions @@ -184,7 +186,7 @@ def has_perms(ctx, **perms): def can_run(**kwargs): async def predicate(ctx): # First check if the command requires ownership of the bot - if kwargs.pop("ownership", False) and not is_owner(ctx): + if kwargs.get("ownership", False) and not is_owner(ctx): return False # Next check if it requires any certain permissions if kwargs and not has_perms(ctx, **kwargs):