Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement application command permissions v2 #1129

Merged
merged 14 commits into from
Mar 19, 2022
Next Next commit
Remove v1 from application commands
  • Loading branch information
Dorukyum committed Jan 15, 2022
commit f0748e6f3e13043d60022db8b3e29535997e0fcd
4 changes: 0 additions & 4 deletions discord/commands/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
from .context import ApplicationContext, AutocompleteContext
from .errors import ApplicationCommandError, CheckFailure, ApplicationCommandInvokeError
from .options import Option, OptionChoice
from .permissions import CommandPermission
from ..enums import SlashCommandOptionType
from ..errors import ValidationError, ClientException
from ..member import Member
Expand Down Expand Up @@ -550,7 +549,6 @@ def __init__(self, func: Callable, *args, **kwargs) -> None:

# Permissions
self.default_permission = kwargs.get("default_permission", True)
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 Expand Up @@ -870,7 +868,6 @@ def __init__(

# Permissions
self.default_permission = kwargs.get("default_permission", True)
self.permissions: List[CommandPermission] = kwargs.get("permissions", [])
if self.permissions and self.default_permission:
self.default_permission = False

Expand Down Expand Up @@ -1087,7 +1084,6 @@ def __init__(self, func: Callable, *args, **kwargs) -> None:
self.validate_parameters()

self.default_permission = kwargs.get("default_permission", True)
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