Skip to content

Commit

Permalink
Fixed checks.has_permissions and checks._bot_has_permissions (#6)
Browse files Browse the repository at this point in the history
* Fixed checks.has_permissions
  • Loading branch information
ahnaf-zamil committed Dec 2, 2020
1 parent 1b7368c commit 9e95e4e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lightbulb/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"check",
]


import functools
import inspect
import operator
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9e95e4e

Please sign in to comment.