Interface AutoCompleteCallbackAction
- All Superinterfaces:
InteractionCallbackAction<Void>
,RestAction<Void>
An
InteractionCallbackAction
that can be used to suggest auto-complete choices.-
Nested Class Summary
Nested classes/interfaces inherited from interface net.dv8tion.jda.api.requests.restaction.interactions.InteractionCallbackAction
InteractionCallbackAction.ResponseType
-
Method Summary
Modifier and TypeMethodDescriptiondefault AutoCompleteCallbackAction
Add up to 25 choices which can be picked from by the user.default AutoCompleteCallbackAction
Add up to 25 choices which can be picked from by the user.default AutoCompleteCallbackAction
Add up to 25 choices which can be picked from by the user.default AutoCompleteCallbackAction
addChoiceDoubles
(double... choices) Add up to 25 choices which can be picked from by the user.default AutoCompleteCallbackAction
addChoiceDoubles
(Collection<Double> choices) Add up to 25 choices which can be picked from by the user.default AutoCompleteCallbackAction
addChoiceLongs
(long... choices) Add up to 25 choices which can be picked from by the user.default AutoCompleteCallbackAction
addChoiceLongs
(Collection<Long> choices) Add up to 25 choices which can be picked from by the user.addChoices
(Collection<Command.Choice> choices) Add up to 25 choices which can be picked from by the user.default AutoCompleteCallbackAction
addChoices
(Command.Choice... choices) Add up to 25 choices which can be picked from by the user.default AutoCompleteCallbackAction
addChoiceStrings
(String... choices) Add up to 25 choices which can be picked from by the user.default AutoCompleteCallbackAction
addChoiceStrings
(Collection<String> choices) Add up to 25 choices which can be picked from by the user.TheOptionType
of the choices you can suggest.Methods inherited from interface net.dv8tion.jda.api.requests.RestAction
addCheck, and, and, complete, complete, completeAfter, deadline, delay, delay, delay, delay, flatMap, flatMap, getCheck, getJDA, map, mapToResult, onErrorFlatMap, onErrorFlatMap, onErrorMap, onErrorMap, queue, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, setCheck, submit, submit, submitAfter, submitAfter, timeout, zip
-
Method Details
-
getOptionType
TheOptionType
of the choices you can suggest.- Returns:
- The option type
-
addChoices
@Nonnull @CheckReturnValue AutoCompleteCallbackAction addChoices(@Nonnull Collection<Command.Choice> choices) Add up to 25 choices which can be picked from by the user.
The user may continue writing inputs instead of using one of your choices.- Parameters:
choices
- The choice suggestions to present to the user, 0-OptionData.MAX_CHOICES
choices- Returns:
- The same callback action, for chaining convenience
- Throws:
IllegalArgumentException
- If any of the following is true:null
is provided- More than 25 are added
- Any of the choice names is empty or longer than 100
- The option type is incompatible with the choice type
- The numeric value of any of the choices is not between -9.007199254740991E15 and 9.007199254740991E15
- The string value of any of the choices is empty or longer than 100
-
addChoices
@Nonnull @CheckReturnValue default AutoCompleteCallbackAction addChoices(@Nonnull Command.Choice... choices) Add up to 25 choices which can be picked from by the user.
The user may continue writing inputs instead of using one of your choices.- Parameters:
choices
- The choice suggestions to present to the user, 0-OptionData.MAX_CHOICES
choices- Returns:
- The same callback action, for chaining convenience
- Throws:
IllegalArgumentException
- If any of the following is true:null
is provided- More than 25 are added
- Any of the choice names is empty or longer than 100
- The option type is incompatible with the choice type
- The numeric value of any of the choices is not between -9.007199254740991E15 and 9.007199254740991E15
- The string value of any of the choices is empty or longer than 100
-
addChoice
@Nonnull @CheckReturnValue default AutoCompleteCallbackAction addChoice(@Nonnull String name, @Nonnull String value) Add up to 25 choices which can be picked from by the user.
The user may continue writing inputs instead of using one of your choices.- Parameters:
name
- The choice name to show to the user, 1-100 charactersvalue
- The choice value, 1-100 characters- Returns:
- The same callback action, for chaining convenience
- Throws:
IllegalArgumentException
- If any of the following is true:null
is provided- More than 25 are added
- The choice name is empty or longer than 100
- The option type is not
OptionType.STRING
- The value is empty or longer than 100
-
addChoice
@Nonnull @CheckReturnValue default AutoCompleteCallbackAction addChoice(@Nonnull String name, long value) Add up to 25 choices which can be picked from by the user.
The user may continue writing inputs instead of using one of your choices.- Parameters:
name
- The choice name to show to the user, 1-100 charactersvalue
- The choice value, must be between -9.007199254740991E15 and 9.007199254740991E15- Returns:
- The same callback action, for chaining convenience
- Throws:
IllegalArgumentException
- If any of the following is true:null
is provided- More than 25 are added
- The choice name is empty or longer than 100
- The option type is incompatible with the choice type
- The value is not between -9.007199254740991E15 and 9.007199254740991E15
-
addChoice
@Nonnull @CheckReturnValue default AutoCompleteCallbackAction addChoice(@Nonnull String name, double value) Add up to 25 choices which can be picked from by the user.
The user may continue writing inputs instead of using one of your choices.- Parameters:
name
- The choice name to show to the user, 1-100 charactersvalue
- The choice value, must be between -9.007199254740991E15 and 9.007199254740991E15- Returns:
- The same callback action, for chaining convenience
- Throws:
IllegalArgumentException
- If any of the following is true:null
is provided- More than 25 are added
- The choice name is empty or longer than 100
- The option type is incompatible with the choice type
- The value is not between -9.007199254740991E15 and 9.007199254740991E15
-
addChoiceStrings
@Nonnull @CheckReturnValue default AutoCompleteCallbackAction addChoiceStrings(@Nonnull String... choices) Add up to 25 choices which can be picked from by the user.
The user may continue writing inputs instead of using one of your choices.The provided strings will be used as value and name for the
Choices
.- Parameters:
choices
- The choice suggestions to present to the user, each limited to 100 characters- Returns:
- The same callback action, for chaining convenience
- Throws:
IllegalArgumentException
- If any of the following is true:
-
addChoiceStrings
@Nonnull @CheckReturnValue default AutoCompleteCallbackAction addChoiceStrings(@Nonnull Collection<String> choices) Add up to 25 choices which can be picked from by the user.
The user may continue writing inputs instead of using one of your choices.The provided strings will be used as value and name for the
Choices
.- Parameters:
choices
- The choice suggestions to present to the user, each limited to 100 characters- Returns:
- The same callback action, for chaining convenience
- Throws:
IllegalArgumentException
- If any of the following is true:
-
addChoiceLongs
@Nonnull @CheckReturnValue default AutoCompleteCallbackAction addChoiceLongs(@Nonnull long... choices) Add up to 25 choices which can be picked from by the user.
The user may continue writing inputs instead of using one of your choices.The string values of the provided longs will be used as value and name for the
Choices
.- Parameters:
choices
- The choice suggestions to present to the user- Returns:
- The same callback action, for chaining convenience
- Throws:
IllegalArgumentException
- If any of the following is true:null
is provided- More than 25 are added
- The option type is incompatible with the choice type
- The numeric value of any of the choices is not between -9.007199254740991E15 and 9.007199254740991E15
-
addChoiceLongs
@Nonnull @CheckReturnValue default AutoCompleteCallbackAction addChoiceLongs(@Nonnull Collection<Long> choices) Add up to 25 choices which can be picked from by the user.
The user may continue writing inputs instead of using one of your choices.The string values of the provided longs will be used as value and name for the
Choices
.- Parameters:
choices
- The choice suggestions to present to the user- Returns:
- The same callback action, for chaining convenience
- Throws:
IllegalArgumentException
- If any of the following is true:null
is provided- More than 25 are added
- The option type is incompatible with the choice type
- The numeric value of any of the choices is not between -9.007199254740991E15 and 9.007199254740991E15
-
addChoiceDoubles
@Nonnull @CheckReturnValue default AutoCompleteCallbackAction addChoiceDoubles(@Nonnull double... choices) Add up to 25 choices which can be picked from by the user.
The user may continue writing inputs instead of using one of your choices.The string values of the provided doubles will be used as value and name for the
Choices
.- Parameters:
choices
- The choice suggestions to present to the user- Returns:
- The same callback action, for chaining convenience
- Throws:
IllegalArgumentException
- If any of the following is true:null
is provided- More than 25 are added
- The option type is incompatible with the choice type
- The numeric value of any of the choices is not between -9.007199254740991E15 and 9.007199254740991E15
-
addChoiceDoubles
@Nonnull @CheckReturnValue default AutoCompleteCallbackAction addChoiceDoubles(@Nonnull Collection<Double> choices) Add up to 25 choices which can be picked from by the user.
The user may continue writing inputs instead of using one of your choices.The string values of the provided doubles will be used as value and name for the
Choices
.- Parameters:
choices
- The choice suggestions to present to the user- Returns:
- The same callback action, for chaining convenience
- Throws:
IllegalArgumentException
- If any of the following is true:null
is provided- More than 25 are added
- The option type is incompatible with the choice type
- The numeric value of any of the choices is not between -9.007199254740991E15 and 9.007199254740991E15
-