Class CommandRequirements
java.lang.Object
xyz.dynxsty.dih4jda.interactions.commands.CommandRequirements
- Direct Known Subclasses:
BaseCommandRequirements,SlashCommand.Subcommand
Allows to set requirements that must be met in order to execute the command.
If a requirement isn't met, this will fire the corresponding event in
DIH4JDAEventListener.- Since:
- v1.5
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal Set<net.dv8tion.jda.api.Permission>final voidrequirePermissions(net.dv8tion.jda.api.Permission... permissions) Allows to require a set ofPermissions which are needed to execute the corresponding command.final voidrequireRoles(Long... roles) Allows to require a set ofLongs (role Ids) which are able to execute the corresponding command.final voidrequireUsers(Long... users) Allows to require a set ofLongs (user Ids) which are able to execute the corresponding command.
-
Constructor Details
-
CommandRequirements
public CommandRequirements()
-
-
Method Details
-
requirePermissions
public final void requirePermissions(net.dv8tion.jda.api.Permission... permissions) Allows to require a set ofPermissions which are needed to execute the corresponding command.- Parameters:
permissions- The set ofPermissions.
-
requireUsers
Allows to require a set ofLongs (user Ids) which are able to execute the corresponding command.- Parameters:
users- The set ofLongs (user Ids).
-
requireRoles
Allows to require a set ofLongs (role Ids) which are able to execute the corresponding command.- Parameters:
roles- The set ofLongs (role Ids).
-
getRequiredPermissions
-
getRequiredUsers
-
getRequiredRoles
-