Annotation Interface Permissions


@Target({METHOD,TYPE}) @Retention(RUNTIME) public @interface Permissions
Interaction classes or interaction methods (commands, components or modals) annotated with Permission will require the user to have the given permissions in order to execute the command.
See Also:
API Note:
This annotation should not be confused with SlashCommand.enabledFor() or ContextCommand.enabledFor(). The enabledFor permissions will be client-side checked by Discord directly, while the Permissions annotation will be used for the own permission system of jda-commands.
Implementation Note:

The PermissionsMiddleware will validate the permissions during the middleware phase of the execution chain. The PermissionsProvider will be called to check the respective user. The default implementation of the PermissionsProvider can only handle Discord permissions(Permission).

Example:

@Permissions("BAN_MEMBERS")
public class BanCommand { ... }
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Returns a String array of all required permissions.
  • Element Details

    • value

      String[] value
      Returns a String array of all required permissions.
      Returns:
      a String array of all required permissions.