Class OrderedMenu

java.lang.Object
com.jagrosh.jdautilities.menu.Menu
com.jagrosh.jdautilities.menu.OrderedMenu

public class OrderedMenu extends Menu
A Menu of ordered buttons signified by numbers or letters, each with a reaction linked to it for users to click.

Up to ten text choices can be set in the OrderedMenu.Builder, and additional methods for handling the resulting choice made by a user using the menu may also be attached via the OrderedMenu.Builder.setSelection(BiConsumer) and OrderedMenu.Builder.setCancel(Consumer) methods.

Author:
John Grosh
  • Field Details

  • Method Details

    • display

      public void display(net.dv8tion.jda.api.entities.channel.middleman.MessageChannel channel)
      Shows the OrderedMenu as a new Message in the provided MessageChannel.
      Specified by:
      display in class Menu
      Parameters:
      channel - The MessageChannel to send the new Message to
      Throws:
      IllegalArgumentException - If all of the following are violated simultaneously:
      • Being sent to a TextChannel.
      • This OrderedMenu does not allow typed input.
      • The bot doesn't have Permission.MESSAGE_ADD_REACTION in the channel this menu is being sent to.
    • display

      public void display(net.dv8tion.jda.api.entities.Message message)
      Displays this OrderedMenu by editing the provided Message.
      Specified by:
      display in class Menu
      Parameters:
      message - The Message to display the Menu in
      Throws:
      IllegalArgumentException - If all of the following are violated simultaneously:
      • Being sent to a TextChannel.
      • This OrderedMenu does not allow typed input.
      • The bot doesn't have Permission.MESSAGE_ADD_REACTION in the channel this menu is being sent to.