JDA-Applications / JDA-Utilities

A series of tools and utilities for JDA to assist in bot creation
Apache License 2.0
218 stars 111 forks source link

requiredRole #95

Open b-ncMN opened 5 years ago

b-ncMN commented 5 years ago

Suggestion

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

DManstrator commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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

where options are RequiredRole.ANY RequiredRole.ALL