1
0
Fork 0
mirror of synced 2024-05-06 21:52:30 +12:00

Change how ownership dict is read

This commit is contained in:
phxntxm 2018-09-23 18:02:19 -05:00
parent a173451164
commit 757b49a3eb

View file

@ -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):