From 9e95e4efd4941a27c7704dd78390ec909724fdb2 Mon Sep 17 00:00:00 2001 From: "K.M Ahnaf Zamil" <57180217+ahnaf-zamil@users.noreply.github.com> Date: Wed, 2 Dec 2020 18:38:01 +0600 Subject: [PATCH] Fixed checks.has_permissions and checks._bot_has_permissions (#6) * Fixed checks.has_permissions --- lightbulb/checks.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lightbulb/checks.py b/lightbulb/checks.py index 75ebe166..e4000bf8 100644 --- a/lightbulb/checks.py +++ b/lightbulb/checks.py @@ -35,6 +35,7 @@ "check", ] + import functools import inspect import operator @@ -210,7 +211,7 @@ async def _bot_has_permissions(ctx: context.Context, *, permissions: hikari.Perm if missing_perms: raise errors.MissingRequiredPermission( - "You are missing one or more permissions required in order to run this command", missing_perms + "I am missing one or more permissions required in order to run this command", missing_perms ) return True @@ -360,7 +361,7 @@ def decorate(command: T_inv) -> T_inv: total_perms = functools.reduce(operator.or_, (*perms, *permissions)) command.user_required_permissions = total_perms - command.add_check(functools.partial(_bot_has_guild_permissions, permissions=total_perms)) + command.add_check(functools.partial(_has_guild_permissions, permissions=total_perms)) return command return decorate