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

requiredRole #95

Open
b-ncMN opened this issue Oct 15, 2019 · 6 comments
Open

requiredRole #95

b-ncMN opened this issue Oct 15, 2019 · 6 comments

Comments

@b-ncMN
Copy link

b-ncMN commented Oct 15, 2019

Suggestion

Add a way to set multiple requiredRole when creating a command.

@DManstrator
Copy link

Yeah, CommandBuilder#setRequiredRoles(String...) or CommandBuilder#setRequiredRoles(Role...) sounds like a good idea. Why not considering making a PR for that? It is kinda a breaking change so better wait for jag or somebody to confirm that tho.

@jagrosh
Copy link
Member

jagrosh commented Oct 15, 2019

The concept of a required role is a very basic one; if you need more fine-tuned permissions, I would recommend writing your specifically-needed permissions checks into a Category.

@b-ncMN
Copy link
Author

b-ncMN commented Oct 15, 2019

Yeah it's what I have done, I even started to write that in the API, I can pull request you if you want.

@jagrosh
Copy link
Member

jagrosh commented Oct 15, 2019

I don't really think it would be good to replace the base system we have now because it would be confusing whether a user was required to have all of the required roles or any of the required roles.

@b-ncMN
Copy link
Author

b-ncMN commented Oct 15, 2019

Oh yeah, I did not thinked about that, well, personally it's more convenient to check if the user have any of the roles. And why not just creating both of them and commenting them to describe to avoid that to happen ?

@HazirBot
Copy link

might as well just throw in an enum
CommandBuilder#setRequiredRoles(RequiredRole role, String...)

where options are
RequiredRole.ANY
RequiredRole.ALL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants