Interface SlashCommandOptionChoice



  • public interface SlashCommandOptionChoice
    A choice for an slash command option.
    • Method Detail

      • getName

        String getName​()
        Gets the name of this choice.
        Returns:
        The name of the choice.
      • getStringValue

        Optional<String> getStringValue​()
        Gets the string value of this choice.

        If this option is an integer choice, the optional will be empty.

        Returns:
        The string value of this choice.
      • getIntValue

        Optional<Integer> getIntValue​()
        Gets the integer value of this choice.

        If this option is an string choice, the optional will be empty.

        Returns:
        The integer value of this choice.
      • getValueAsString

        default String getValueAsString​()
        Gets the value of this choice as a string.

        If the value is an integer, its string representation will be returned.

        Returns:
        The value of the choice as a string.
      • create

        static SlashCommandOptionChoice create​(String name,
                                               String value)
        Create a new option choice builder to be used with a command option builder.
        Parameters:
        name - The name of the choice.
        value - The value of the choice.
        Returns:
        The new choice builder.
      • create

        static SlashCommandOptionChoice create​(String name,
                                               int value)
        Create a new option choice builder to be used with a command option builder.
        Parameters:
        name - The name of the choice.
        value - The value of the choice.
        Returns:
        The new choice builder.