Package com.jagrosh.jdautilities.menu
Class OrderedMenu
java.lang.Object
com.jagrosh.jdautilities.menu.Menu
com.jagrosh.jdautilities.menu.OrderedMenu
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
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Methods inherited from class com.jagrosh.jdautilities.menu.Menu
isValidUser, isValidUser
-
Field Details
-
NUMBERS
-
LETTERS
-
CANCEL
- See Also:
-
-
Method Details
-
display
public void display(net.dv8tion.jda.api.entities.MessageChannel channel) Shows the OrderedMenu as a newMessagein the providedMessageChannel.- Specified by:
displayin classMenu- 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_REACTIONin the channel this menu is being sent to.
- Being sent to a
-
display
public void display(net.dv8tion.jda.api.entities.Message message) Displays this OrderedMenu by editing the providedMessage.- Specified by:
displayin classMenu- 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_REACTIONin the channel this menu is being sent to.
- Being sent to a
-