Class SlashCommandOptionBuilder


  • public class SlashCommandOptionBuilder
    extends java.lang.Object
    • Constructor Detail

      • SlashCommandOptionBuilder

        public SlashCommandOptionBuilder()
        Creates a new slash command option builder.
    • Method Detail

      • setName

        public SlashCommandOptionBuilder setName​(java.lang.String name)
        Sets the name of the slash command option.
        Parameters:
        name - The name.
        Returns:
        The current instance in order to chain call methods.
      • addNameLocalization

        public SlashCommandOptionBuilder addNameLocalization​(DiscordLocale locale,
                                                             java.lang.String localization)
        Adds a name localization for the given locale.
        Parameters:
        locale - The locale to add this localization for.
        localization - The option name localization.
        Returns:
        The current instance in order to chain call methods.
      • setDescription

        public SlashCommandOptionBuilder setDescription​(java.lang.String description)
        Sets the description of the slash command option.
        Parameters:
        description - The description.
        Returns:
        The current instance in order to chain call methods.
      • addDescriptionLocalization

        public SlashCommandOptionBuilder addDescriptionLocalization​(DiscordLocale locale,
                                                                    java.lang.String localization)
        Adds a description localization for the given locale.
        Parameters:
        locale - The locale to add this localization for.
        localization - The option description localization.
        Returns:
        The current instance in order to chain call methods.
      • setRequired

        public SlashCommandOptionBuilder setRequired​(boolean required)
        Sets if the slash command option is required.
        Parameters:
        required - Whether the option is required.
        Returns:
        The current instance in order to chain call methods.
      • setAutocompletable

        public SlashCommandOptionBuilder setAutocompletable​(boolean autocompletable)
        Sets if this option can be autocompleted.
        Parameters:
        autocompletable - Whether the option can be autocompleted.
        Returns:
        The current instance in order to chain call methods.
      • addChoice

        public SlashCommandOptionBuilder addChoice​(java.lang.String name,
                                                   java.lang.String value)
        Adds a string choice for the slash command option.
        Parameters:
        name - The name of the choice.
        value - The value of the choice.
        Returns:
        The current instance in order to chain call methods.
      • addChoice

        public SlashCommandOptionBuilder addChoice​(java.lang.String name,
                                                   int value)
        Adds an int choice for the slash command option.
        Parameters:
        name - The name of the choice.
        value - The value of the choice.
        Returns:
        The current instance in order to chain call methods.
      • setChoices

        public SlashCommandOptionBuilder setChoices​(java.util.List<SlashCommandOptionChoice> choices)
        Sets the choices of the slash command option.
        Parameters:
        choices - The choices.
        Returns:
        The current instance in order to chain call methods.
      • addOption

        public SlashCommandOptionBuilder addOption​(SlashCommandOption option)
        Adds a slash command option to the slash command option.
        Parameters:
        option - The option.
        Returns:
        The current instance in order to chain call methods.
      • setOptions

        public SlashCommandOptionBuilder setOptions​(java.util.List<SlashCommandOption> options)
        Sets the slash commands for the slash command option.
        Parameters:
        options - The options.
        Returns:
        The current instance in order to chain call methods.
      • addChannelType

        public SlashCommandOptionBuilder addChannelType​(ChannelType channelType)
        Adds a channel type to the slash command option.
        Parameters:
        channelType - The channel type.
        Returns:
        The current instance in order to chain call methods.
      • setChannelTypes

        public SlashCommandOptionBuilder setChannelTypes​(java.util.Collection<ChannelType> channelTypes)
        Sets the channel types for the slash command option.
        Parameters:
        channelTypes - The channel types.
        Returns:
        The current instance in order to chain call methods.
      • setLongMinValue

        public SlashCommandOptionBuilder setLongMinValue​(long longMinValue)
        Sets the minimum value permitted for the SlashCommandOptionType.LONG slash command option.
        Parameters:
        longMinValue - The minimum value permitted.
        Returns:
        The current instance in order to chain call methods
      • setLongMaxValue

        public SlashCommandOptionBuilder setLongMaxValue​(long longMaxValue)
        Sets the maximum value permitted for the SlashCommandOptionType.LONG slash command option.
        Parameters:
        longMaxValue - The maximum value permitted.
        Returns:
        The current instance in order to chain call methods
      • setDecimalMinValue

        public SlashCommandOptionBuilder setDecimalMinValue​(double decimalMinValue)
        Sets the minimum value permitted for the SlashCommandOptionType.DECIMAL slash command option.
        Parameters:
        decimalMinValue - The minimum value permitted.
        Returns:
        The current instance in order to chain call methods
      • setDecimalMaxValue

        public SlashCommandOptionBuilder setDecimalMaxValue​(double decimalMaxValue)
        Sets the maximum value permitted for the SlashCommandOptionType.DECIMAL slash command option.
        Parameters:
        decimalMaxValue - The maximum value permitted.
        Returns:
        The current instance in order to chain call methods
      • build

        public SlashCommandOption build()
        Builds the slash command option.
        Returns:
        The built option.