Interface AutoCompleteCallbackAction
- All Superinterfaces:
FluentRestAction<Void,
,AutoCompleteCallbackAction> InteractionCallbackAction<Void>
,RestAction<Void>
public interface AutoCompleteCallbackAction
extends InteractionCallbackAction<Void>, FluentRestAction<Void,AutoCompleteCallbackAction>
An
InteractionCallbackAction
that can be used to suggest auto-complete choices.- See Also:
-
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.FluentRestAction
addCheck, deadline, setCheck, timeout
Methods inherited from interface net.dv8tion.jda.api.requests.restaction.interactions.InteractionCallbackAction
closeResources
Methods inherited from interface net.dv8tion.jda.api.requests.RestAction
and, and, complete, complete, completeAfter, delay, delay, delay, delay, flatMap, flatMap, getCheck, getJDA, map, mapToResult, onErrorFlatMap, onErrorFlatMap, onErrorMap, onErrorMap, onSuccess, queue, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, submit, submit, submitAfter, submitAfter, 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
null
is provided - If more than 25 choices are added
- If any of the choice names are empty or longer than 100
- If the option type is incompatible with the choice type
- If the numeric value of any of the choices is not between -9.007199254740991E15 and 9.007199254740991E15
- If the string value of any of the choices is empty or longer than 100
- If
-
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
null
is provided - If more than 25 choices are added
- If any of the choice names are empty or longer than 100
- If the option type is incompatible with the choice type
- If the numeric value of any of the choices is not between -9.007199254740991E15 and 9.007199254740991E15
- If the string value of any of the choices is empty or longer than 100
- If
-
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
null
is provided - If more than 25 choices are added
- If the choice name is empty or longer than 100
- If the option type is not
OptionType.STRING
- If the value is empty or longer than 100
- If
-
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
null
is provided - If more than 25 choices are added
- If the choice name is empty or longer than 100
- If the option type is incompatible with the choice type
- If the value is not between -9.007199254740991E15 and 9.007199254740991E15
- If
-
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
null
is provided - If more than 25 choices are added
- If the choice name is empty or longer than 100
- If the option type is incompatible with the choice type
- If the value is not between -9.007199254740991E15 and 9.007199254740991E15
- If
-
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
-
-
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
-
-
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
null
is provided - If more than 25 choices are added
- If the option type is incompatible with the choice type
- If the numeric value of any of the choices is not between -9.007199254740991E15 and 9.007199254740991E15
- If
-
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
null
is provided - If more than 25 choices are added
- If the option type is incompatible with the choice type
- If the numeric value of any of the choices is not between -9.007199254740991E15 and 9.007199254740991E15
- If
-
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
null
is provided - If more than 25 choices are added
- If the option type is incompatible with the choice type
- If the numeric value of any of the choices is not between -9.007199254740991E15 and 9.007199254740991E15
- If
-
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
null
is provided - If more than 25 choices are added
- If the option type is incompatible with the choice type
- If the numeric value of any of the choices is not between -9.007199254740991E15 and 9.007199254740991E15
- If
-