Annotation Type Alias


  • @Retention(RUNTIME)
    @Target(TYPE)
    @Repeatable(Aliases.class)
    @Documented
    public @interface Alias
    An annotation with which one or more aliases for a command can be configured. If at least one alias is configured, only the explicitly configured ones are available. If no alias is configured, the class name, stripped by Command or Cmd suffix and / or prefix if present and the first letter lowercased is used as default.

    When injecting a List<SlashCommandBuilder> anywhere, all aliases of commands implementing SlashCommandJavacord have to follow a pre-defined format that is described at SlashCommandJavacord.

    Alternatively to using this annotation the Command.getAliases() method can be overwritten. If that method is overwritten and this annotation is used, the method overwrite takes precedence. That method is also what should be used to retrieve the configured aliases.

    See Also:
    Command.getAliases()
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      String value
      Returns the alias for the annotated command.
    • Element Detail

      • value

        String value
        Returns the alias for the annotated command.
        Returns:
        the alias for the annotated command