Annotation Interface Param


@Target(PARAMETER) @Retention(RUNTIME) public @interface Param
Annotation used to add metadata, e.g. a description, to command options.
See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Returns the name of the command option.
    boolean
    Returns whether this command option is optional.
    net.dv8tion.jda.api.interactions.commands.OptionType
    Returns the OptionType of this command option.
    Returns the description of the command option.
  • Element Details

    • value

      String value
      Returns the description of the command option. This value will only be used for slash commands.
      Returns:
      the description of the command option
      Default:
      ""
    • name

      String name
      Returns the name of the command option. Use the compiler flag -parameters to have the parameter name resolved at runtime making this field redundant.
      Returns:
      the name of the command option
      Default:
      ""
    • optional

      boolean optional
      Returns whether this command option is optional. If the parameter class is an Optional this is automatically set to true.
      Returns:
      true if this command option is optional
      See Also:
      Default:
      false
    • type

      net.dv8tion.jda.api.interactions.commands.OptionType type
      Returns the OptionType of this command option.
      Returns:
      the OptionType of this command option
      Implementation Note:
      If OptionType.UNKNOWN is passed (default value), jda-commands will interpolate the best fitting OptionType, resulting to OptionType.STRING as a fallback.
      Default:
      UNKNOWN