Class SlashCommandOptionBuilder



  • public class SlashCommandOptionBuilder
    extends Object
    • Constructor Detail

      • SlashCommandOptionBuilder

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

      • setName

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

        public SlashCommandOptionBuilder setDescription​(String description)
        Sets the description of the slash command option.
        Parameters:
        description - The description.
        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 or not the option is required.
        Returns:
        The current instance in order to chain call methods.
      • addChoice

        public SlashCommandOptionBuilder addChoice​(String name,
                                                   String value)
        Adds an 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​(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.
      • addOption

        public SlashCommandOptionBuilder addOption​(SlashCommandOption option)
        Adds an 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​(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.
      • build

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