Skip to content

Commit

Permalink
Fix Permission->CommandPermission rename for ContextMenuCommand (#672)
Browse files Browse the repository at this point in the history
* fix permission rename for ContextMenuCommand

* fix docstring
  • Loading branch information
krittick authored Dec 31, 2021
1 parent a807e9a commit 6927707
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions discord/commands/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ class ContextMenuCommand(ApplicationCommand):
The ids of the guilds where this command will be registered.
default_permission: :class:`bool`
Whether the command is enabled by default when it is added to a guild.
permissions: List[:class:`.Permission`]
permissions: List[:class:`.CommandPermission`]
The permissions for this command.
.. note::
Expand Down Expand Up @@ -999,7 +999,7 @@ def __init__(self, func: Callable, *args, **kwargs) -> None:
self.validate_parameters()

self.default_permission = kwargs.get("default_permission", True)
self.permissions: List[Permission] = getattr(func, "__app_cmd_perms__", []) + kwargs.get("permissions", [])
self.permissions: List[CommandPermission] = getattr(func, "__app_cmd_perms__", []) + kwargs.get("permissions", [])
if self.permissions and self.default_permission:
self.default_permission = False

Expand Down

0 comments on commit 6927707

Please sign in to comment.