Class ComboArgument


  • public class ComboArgument
    extends InputArgument<java.lang.Object,​Choice>
    Represents an InputArgument that has multiple choices, and they are the only valid values for the user to pick The values are key value pairs The key is String and the value can be String or Long
    • Constructor Detail

      • ComboArgument

        public ComboArgument​(java.lang.String name,
                             java.lang.String description,
                             org.javacord.api.interaction.SlashCommandOptionType type)
        Constructs the argument with the default requirements
        Parameters:
        name - the argument's name
        description - the argument's description
        type - the type of the input value, can be SlashCommandOptionType.STRING or SlashCommandOptionType.LONG
    • Method Detail

      • addChoice

        public void addChoice​(java.lang.String key,
                              java.lang.String value)
        Adds a choice
        Parameters:
        key - is the name of the argument
        value - is the value of the argument as String
      • addChoice

        public void addChoice​(java.lang.String key,
                              long value)
        Adds a choice
        Parameters:
        key - the name of the argument
        value - the value of the argument as Long
      • getChoice

        public Choice getChoice​(java.lang.Object value)
        Returns the choice based on value
        Parameters:
        value - the value
      • getCommandOption

        public org.javacord.api.interaction.SlashCommandOption getCommandOption()
        Overrides:
        getCommandOption in class InputArgument<java.lang.Object,​Choice>
        Returns:
        the command option that need for to register the argument