From 26e9e53c80205efc86bff8e859e23820c43519b1 Mon Sep 17 00:00:00 2001 From: phxntxm Date: Sun, 23 Sep 2018 17:37:39 -0500 Subject: [PATCH] Correct syntax error in check --- cogs/utils/checks.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cogs/utils/checks.py b/cogs/utils/checks.py index ca5a424..65d7012 100644 --- a/cogs/utils/checks.py +++ b/cogs/utils/checks.py @@ -79,7 +79,7 @@ def should_ignore(ctx): return str(ctx.message.author.id) in ignored['members'] or str(ctx.message.channel.id) in ignored['channels'] -def check_restricted(ctx): +async def check_restricted(ctx): # 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 @@ -155,7 +155,7 @@ def check_restricted(ctx): return True -def can_run(ctx, **perms): +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 @@ -181,16 +181,16 @@ def can_run(ctx, **perms): return guild_perms >= required_perm or channel_perms >= required_perm -def can_run(**kwargs): +async def can_run(**kwargs): def predicate(ctx): # First check if the command requires ownership of the bot if kwargs.pop("ownership", False) and not is_owner(ctx): return False # Next check if it requires any certain permissions - if kwargs and not can_run(ctx, **kwargs): + if kwargs and not has_perms(ctx, **kwargs): return False # Next...check custom restrictions - if check_restricted(ctx): + if await check_restricted(ctx): return False # Then if the user/channel should be ignored if should_ignore(ctx):