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:
  • Method Details

    • getOptionType

      @Nonnull OptionType getOptionType()
      The OptionType 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
    • 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
    • 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 characters
      value - 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
    • 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 characters
      value - 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
    • 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 characters
      value - 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
    • 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 null is provided
      • If more than 25 choices are added
      • If any of the choice names are empty or longer than 100
      • If the string value of any of the choices is empty or longer than 100
    • 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 null is provided
      • If more than 25 choices are added
      • If any of the choice names are empty or longer than 100
      • If the string value of any of the choices is empty or longer than 100
    • 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
    • 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
    • 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
    • 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