public static class ButtonMenu.Builder extends Menu.Builder<ButtonMenu.Builder,ButtonMenu>
Menu.Builder
for
a ButtonMenu
.Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
ButtonMenu.Builder |
addChoice(net.dv8tion.jda.core.entities.Emote emote)
Adds a single custom
Emote as button choices. |
ButtonMenu.Builder |
addChoice(java.lang.String emoji)
Adds a single String unicode emoji as a button choice.
|
ButtonMenu.Builder |
addChoices(net.dv8tion.jda.core.entities.Emote... emotes)
Adds custom
Emote s as button choices. |
ButtonMenu.Builder |
addChoices(java.lang.String... emojis)
Adds String unicode emojis as button choices.
|
ButtonMenu |
build()
Builds the
ButtonMenu
with this Builder. |
ButtonMenu.Builder |
setAction(java.util.function.Consumer<net.dv8tion.jda.core.entities.MessageReaction.ReactionEmote> action)
Sets the
Consumer action to perform upon selecting a button. |
ButtonMenu.Builder |
setChoices(net.dv8tion.jda.core.entities.Emote... emotes)
Sets the
Emote s as button choices. |
ButtonMenu.Builder |
setChoices(java.lang.String... emojis)
Sets the String unicode emojis as button choices.
|
ButtonMenu.Builder |
setColor(java.awt.Color color)
Sets the
Color of the MessageEmbed . |
ButtonMenu.Builder |
setDescription(java.lang.String description)
Sets the description to be placed in an
MessageEmbed . |
ButtonMenu.Builder |
setFinalAction(java.util.function.Consumer<net.dv8tion.jda.core.entities.Message> finalAction)
Sets the
Consumer to perform if the
ButtonMenu is done,
either via cancellation, a timeout, or a selection being made. |
ButtonMenu.Builder |
setText(java.lang.String text)
Sets the text of the
Message to be displayed
when the ButtonMenu is built. |
addRoles, addUsers, setEventWaiter, setRoles, setTimeout, setUsers
public ButtonMenu build()
ButtonMenu
with this Builder.build
in class Menu.Builder<ButtonMenu.Builder,ButtonMenu>
java.lang.IllegalArgumentException
- If one of the following is violated:
EventWaiter
was set.Consumer
was set.public ButtonMenu.Builder setColor(java.awt.Color color)
Color
of the MessageEmbed
.color
- The Color of the MessageEmbedpublic ButtonMenu.Builder setText(java.lang.String text)
Message
to be displayed
when the ButtonMenu
is built.
This is displayed directly above the embed.
text
- The Message content to be displayed above the embed when the ButtonMenu is builtpublic ButtonMenu.Builder setDescription(java.lang.String description)
MessageEmbed
.
null
, no MessageEmbed will be displayeddescription
- The content of the MessageEmbed's descriptionpublic ButtonMenu.Builder setAction(java.util.function.Consumer<net.dv8tion.jda.core.entities.MessageReaction.ReactionEmote> action)
Consumer
action to perform upon selecting a button.action
- The Consumer action to perform upon selecting a buttonpublic ButtonMenu.Builder setFinalAction(java.util.function.Consumer<net.dv8tion.jda.core.entities.Message> finalAction)
Consumer
to perform if the
ButtonMenu
is done,
either via cancellation, a timeout, or a selection being made.This accepts the message used to display the menu when called.
finalAction
- The Runnable action to perform if the ButtonMenu is donepublic ButtonMenu.Builder addChoice(java.lang.String emoji)
Any non-unicode Emote
should be
added using ButtonMenu.Builder#addChoice(Emote)
.
emoji
- The String unicode emoji to addpublic ButtonMenu.Builder addChoice(net.dv8tion.jda.core.entities.Emote emote)
Emote
as button choices.
Any regular unicode emojis should be added using ButtonMenu.Builder#addChoice(String)
.
emote
- The Emote object to addpublic ButtonMenu.Builder addChoices(java.lang.String... emojis)
Any non-unicode Emote
s should be
added using ButtonMenu.Builder#addChoices(Emote...)
.
emojis
- The String unicode emojis to addpublic ButtonMenu.Builder addChoices(net.dv8tion.jda.core.entities.Emote... emotes)
Emote
s as button choices.
Any regular unicode emojis should be added using ButtonMenu.Builder#addChoices(String...)
.
emotes
- The Emote objects to addpublic ButtonMenu.Builder setChoices(java.lang.String... emojis)
Any non-unicode Emote
s should be
set using ButtonMenu.Builder#setChoices(Emote...)
.
emojis
- The String unicode emojis to setpublic ButtonMenu.Builder setChoices(net.dv8tion.jda.core.entities.Emote... emotes)
Emote
s as button choices.
Any regular unicode emojis should be set using ButtonMenu.Builder#setChoices(String...)
.
emotes
- The Emote objects to set