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
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
display
(net.dv8tion.jda.api.entities.channel.middleman.MessageChannel channel) Shows the OrderedMenu as a newMessage
in the providedMessageChannel
.void
display
(net.dv8tion.jda.api.entities.Message message) Displays this OrderedMenu by editing the providedMessage
.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.channel.middleman.MessageChannel channel) Shows the OrderedMenu as a newMessage
in the providedMessageChannel
.- Specified by:
display
in 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_REACTION
in 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:
display
in 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_REACTION
in the channel this menu is being sent to.
- Being sent to a
-