Class SelectMenu

    • Method Detail

      • of

        public static SelectMenu of​(String customId,
                                    SelectMenu.Option... options)
        Creates a select menu.
        Parameters:
        customId - A developer-defined identifier for the select menu.
        options - The options that can be selected in the menu.
        Returns:
        A select menu with the given data.
      • of

        public static SelectMenu of​(String customId,
                                    List<SelectMenu.Option> options)
        Creates a select menu.
        Parameters:
        customId - A developer-defined identifier for the select menu.
        options - The options that can be selected in the menu.
        Returns:
        A select menu with the given data.
      • getCustomId

        public String getCustomId()
        Gets the select menu's custom id.
        Returns:
        The select menu's custom id.
      • getPlaceholder

        public Optional<String> getPlaceholder()
        Gets the text displayed if no option is selected.
        Returns:
        The text displayed if no option is selected.
      • getMinValues

        public int getMinValues()
        Gets the minimum number of options that must be chosen.
        Returns:
        The minimum number of options that must be chosen.
      • getMaxValues

        public int getMaxValues()
        Gets the maximum number of options that must be chosen.
        Returns:
        The maximum number of options that must be chosen.
      • getOptions

        public List<SelectMenu.Option> getOptions()
        Gets the options that can be selected in the menu.
        Returns:
        The options that can be selected in the menu.
      • isDisabled

        public boolean isDisabled()
        Gets whether the select menu is disabled (i.e., the user is prevented from selecting any options).
        Returns:
        Whether the select menu is disabled.
      • disabled

        public SelectMenu disabled()
        Creates a new select menu with the same data as this one, but disabled.
        Returns:
        A new disabled select menu with the same data as this one.
      • disabled

        public SelectMenu disabled​(boolean value)
        Creates a new select menu with the same data as this one, but depending on the value param it may be disabled or not.
        Parameters:
        value - True if the select menu should be disabled otherwise False.
        Returns:
        A new possibly disabled select menu with the same data as this one.
      • withPlaceholder

        public SelectMenu withPlaceholder​(String placeholder)
        Creates a new select menu with the same data as this one, but with the given placeholder text.
        Parameters:
        placeholder - The new placeholder text.
        Returns:
        A new select menu with the given placeholder text.
      • withMinValues

        public SelectMenu withMinValues​(int minValues)
        Creates a new select menu with the same data as this one, but with the given minimum values.
        Parameters:
        minValues - The new minimum values.
        Returns:
        A new select menu with the given minimum values.
      • withMaxValues

        public SelectMenu withMaxValues​(int maxValues)
        Creates a new select menu with the same data as this one, but with the given maximum values.
        Parameters:
        maxValues - The new maximum values.
        Returns:
        A new select menu with the given maximum values.