We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Make @discord.app_commands.default_permissions() take a Permissions object
The core library
Right now, I can create a permissions object:
ADMIN_PERMISSIONS = Permissions( moderate_members=True )
and I can add permissions to a function:
new_func = app_commands.default_permissions(moderate_members=True)(new_func)
but I can't pass a Permissions object to the default_permissions() decorator
# Doesn't work new_func = app_commands.default_permissions(ADMIN_PERMISSIONS)(new_func)
Right now, the decorator just takes the permissions it's passed and creates an object anyway:
discord.py/discord/app_commands/commands.py
Line 2860 in 59f877f
So I don't see why I can't just pass a Permissions object.
Either modify the default_permissions() decorator to optionally take a Permissions object or create a new decorator that does the same thing.
Thank you so much for this incredible library!
The text was updated successfully, but these errors were encountered:
My current solution is to do:
new_func = app_commands.default_permissions(**dict(ADMIN_PERMISSIONS))(new_func)
and it works, but it feels ugly
Sorry, something went wrong.
b207c8a
No branches or pull requests
Summary
Make @discord.app_commands.default_permissions() take a Permissions object
What is the feature request for?
The core library
The Problem
Right now, I can create a permissions object:
and I can add permissions to a function:
but I can't pass a Permissions object to the default_permissions() decorator
Right now, the decorator just takes the permissions it's passed and creates an object anyway:
discord.py/discord/app_commands/commands.py
Line 2860 in 59f877f
So I don't see why I can't just pass a Permissions object.
The Ideal Solution
Either modify the default_permissions() decorator to optionally take a Permissions object or create a new decorator that does the same thing.
The Current Solution
Additional Context
Thank you so much for this incredible library!
The text was updated successfully, but these errors were encountered: