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

Fix bridge.has_permissions #1695

Merged
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 6 additions & 4 deletions discord/ext/bridge/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ class BridgeSlashGroup(SlashCommandGroup):
__slots__ = ("module",)

def __init__(self, callback, *args, **kwargs):
if perms := getattr(callback, "__default_member_permissions__", None):
kwargs["default_member_permissions"] = perms
super().__init__(*args, **kwargs)
self.callback = callback
self.__original_kwargs__["callback"] = callback
Expand Down Expand Up @@ -453,13 +455,13 @@ def predicate(func: Callable | ApplicationCommand):
from ..commands import has_permissions

func = has_permissions(**perms)(func)
Permissions(**perms)
_perms = Permissions(**perms)
if isinstance(func, ApplicationCommand):
func.default_member_permissions = perms
func.default_member_permissions = _perms
else:
func.__default_member_permissions__ = perms
func.__default_member_permissions__ = _perms

return perms
return func

return predicate

Expand Down