Change how ownership dict is read
This commit is contained in:
parent
a173451164
commit
757b49a3eb
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue