Class ComboArgument
- java.lang.Object
-
- me.s3ns3iw00.jcommands.argument.Argument<O>
-
- me.s3ns3iw00.jcommands.argument.InputArgument<java.lang.Object,Choice>
-
- me.s3ns3iw00.jcommands.argument.type.ComboArgument
-
public class ComboArgument extends InputArgument<java.lang.Object,Choice>
Represents anInputArgumentthat has multiple choices, and they are the only valid values for the user to pick The values are key value pairs The key isStringand the value can beStringorLong
-
-
Constructor Summary
Constructors Constructor Description ComboArgument(java.lang.String name, java.lang.String description, org.javacord.api.interaction.SlashCommandOptionType type)Constructs the argument with the default requirements
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChoice(java.lang.String key, long value)Adds a choicevoidaddChoice(java.lang.String key, java.lang.String value)Adds a choiceChoicegetChoice(java.lang.Object value)Returns the choice based on valueorg.javacord.api.interaction.SlashCommandOptiongetCommandOption()java.lang.Class<Choice>getResultType()-
Methods inherited from class me.s3ns3iw00.jcommands.argument.InputArgument
convertResult, getArgumentValidator, getResultConverter, isOptional, setOptional
-
Methods inherited from class me.s3ns3iw00.jcommands.argument.Argument
getDescription, getMismatchListener, getName, getType, setOnMismatch
-
-
-
-
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 namedescription- the argument's descriptiontype- the type of the input value, can beSlashCommandOptionType.STRINGorSlashCommandOptionType.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 argumentvalue- is the value of the argument asString
-
addChoice
public void addChoice(java.lang.String key, long value)Adds a choice- Parameters:
key- the name of the argumentvalue- the value of the argument asLong
-
getChoice
public Choice getChoice(java.lang.Object value)
Returns the choice based on value- Parameters:
value- the value
-
getResultType
public java.lang.Class<Choice> getResultType()
- Overrides:
getResultTypein classInputArgument<java.lang.Object,Choice>- Returns:
- the class of the result's type
-
getCommandOption
public org.javacord.api.interaction.SlashCommandOption getCommandOption()
- Overrides:
getCommandOptionin classInputArgument<java.lang.Object,Choice>- Returns:
- the command option that need for to register the argument
-
-