Interface Button
-
- All Superinterfaces:
Component,LowLevelComponent
public interface Button extends LowLevelComponent
This interface represents a Button component.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static Buttoncreate(String customId, ButtonStyle style, String label)Create a new button with the given properties.static Buttoncreate(String customId, ButtonStyle style, String label, String unicodeEmoji)Create a new button with the given properties.static Buttoncreate(String customId, ButtonStyle style, String label, Emoji emoji)Create a new button with the given properties.static Buttoncreate(String customId, ButtonStyle style, Emoji emoji)Create a new button with the given properties.static Buttondanger(String customId, String label)Create a new button with the red danger style and the given properties.static Buttondanger(String customId, String label, String unicodeEmoji)Create a new button with the red danger style and the given properties.static Buttondanger(String customId, String label, Emoji emoji)Create a new button with the red danger style and the given properties.static Buttondanger(String customId, Emoji emoji)Create a new button with the red danger style and the given emoji.Optional<String>getCustomId()Get the button's identifier.Optional<Emoji>getEmoji()Get the emoji button's emoji.Optional<String>getLabel()Get the button's label.ButtonStylegetStyle()Get the button's style.Optional<String>getUrl()Get the button's clickable URL.Optional<Boolean>isDisabled()Get whether or not the button is disabled.static Buttonlink(String url, String label)Create a new button for a link button.static Buttonlink(String url, String label, String unicodeEmoji)Create a new button for a link button.static Buttonlink(String url, String label, Emoji emoji)Create a new button for a link button.static Buttonlink(String url, Emoji emoji)Create a new button for a link button.static Buttonprimary(String customId, String label)Create a new button with the blurple primary style and the given properties.static Buttonprimary(String customId, String label, String unicodeEmoji)Create a new button with the blurple primary style and the given properties.static Buttonprimary(String customId, String label, Emoji emoji)Create a new button with the blurple primary style and the given properties.static Buttonprimary(String customId, Emoji emoji)Create a new button with the blurple primary style and the given emoji.static Buttonsecondary(String customId, String label)Create a new button with the grey secondary style and the given properties.static Buttonsecondary(String customId, String label, String unicodeEmoji)Create a new button with the grey secondary style and the given properties.static Buttonsecondary(String customId, String label, Emoji emoji)Create a new button with the grey secondary style and the given properties.static Buttonsecondary(String customId, Emoji emoji)Create a new button with the grey secondary style and the given emoji.static Buttonsuccess(String customId, String label)Create a new button with the green success style and the given properties.static Buttonsuccess(String customId, String label, String unicodeEmoji)Create a new button with the green success style and the given properties.static Buttonsuccess(String customId, String label, Emoji emoji)Create a new button with the green success style and the given properties.static Buttonsuccess(String customId, Emoji emoji)Create a new button with the green success style and the given emoji.
-
-
-
Method Detail
-
getStyle
ButtonStyle getStyle()
Get the button's style.- Returns:
- The button's style.
-
getCustomId
Optional<String> getCustomId()
Get the button's identifier.- Returns:
- The button's custom identifier.
-
isDisabled
Optional<Boolean> isDisabled()
Get whether or not the button is disabled.- Returns:
- Whether or not the button is disabled.
-
getEmoji
Optional<Emoji> getEmoji()
Get the emoji button's emoji.- Returns:
- The emoji button's emoji.
-
danger
static Button danger(String customId, String label)
Create a new button with the red danger style and the given properties. This is a convenience shorthand method.- Parameters:
customId- The custom id for this button.label- The label for this button.- Returns:
- the new button to be used with an ActionRow or a message
-
danger
static Button danger(String customId, String label, Emoji emoji)
Create a new button with the red danger style and the given properties. This is a convenience shorthand method.- Parameters:
customId- The custom id for this button.label- The label for this button.emoji- The emoji for this button.- Returns:
- the new button to be used with an ActionRow or a message
-
danger
static Button danger(String customId, String label, String unicodeEmoji)
Create a new button with the red danger style and the given properties. This is a convenience shorthand method.- Parameters:
customId- The custom id for this button.label- The label for this button.unicodeEmoji- The emoji for this button.- Returns:
- the new button to be used with an ActionRow or a message
-
danger
static Button danger(String customId, Emoji emoji)
Create a new button with the red danger style and the given emoji. If you want to use an unicode emoji, usedanger(String, String, String)instead and passnullas your label. This is a convenience shorthand method.- Parameters:
customId- The custom id for this button.emoji- The emoji for this button.- Returns:
- the new button to be used with an ActionRow or a message
-
primary
static Button primary(String customId, String label)
Create a new button with the blurple primary style and the given properties. This is a convenience shorthand method.- Parameters:
customId- The custom id for this button.label- The label for this button.- Returns:
- the new button to be used with an ActionRow or a message
-
primary
static Button primary(String customId, String label, Emoji emoji)
Create a new button with the blurple primary style and the given properties. This is a convenience shorthand method.- Parameters:
customId- The custom id for this button.label- The label for this button.emoji- The emoji for this button.- Returns:
- the new button to be used with an ActionRow or a message
-
primary
static Button primary(String customId, String label, String unicodeEmoji)
Create a new button with the blurple primary style and the given properties. This is a convenience shorthand method.- Parameters:
customId- The custom id for this button.label- The label for this button.unicodeEmoji- The emoji for this button.- Returns:
- the new button to be used with an ActionRow or a message
-
primary
static Button primary(String customId, Emoji emoji)
Create a new button with the blurple primary style and the given emoji. If you want to use an unicode emoji, useprimary(String, String, String)instead and passnullas your label. This is a convenience shorthand method.- Parameters:
customId- The custom id for this button.emoji- The emoji for this button.- Returns:
- the new button to be used with an ActionRow or a message
-
secondary
static Button secondary(String customId, String label)
Create a new button with the grey secondary style and the given properties. This is a convenience shorthand method.- Parameters:
customId- The custom id for this button.label- The label for this button.- Returns:
- the new button to be used with an ActionRow or a message
-
secondary
static Button secondary(String customId, String label, Emoji emoji)
Create a new button with the grey secondary style and the given properties. This is a convenience shorthand method.- Parameters:
customId- The custom id for this button.label- The label for this button.emoji- The emoji for this button.- Returns:
- the new button to be used with an ActionRow or a message
-
secondary
static Button secondary(String customId, String label, String unicodeEmoji)
Create a new button with the grey secondary style and the given properties. This is a convenience shorthand method.- Parameters:
customId- The custom id for this button.label- The label for this button.unicodeEmoji- The emoji for this button.- Returns:
- the new button to be used with an ActionRow or a message
-
secondary
static Button secondary(String customId, Emoji emoji)
Create a new button with the grey secondary style and the given emoji. If you only want to use an unicode emoji, usesecondary(String, String, String)instead and passnullas your label. This is a convenience shorthand method.- Parameters:
customId- The custom id for this button.emoji- The emoji for this button.- Returns:
- the new button to be used with an ActionRow or a message
-
success
static Button success(String customId, String label)
Create a new button with the green success style and the given properties. This is a convenience shorthand method.- Parameters:
customId- The custom id for this button.label- The label for this button.- Returns:
- the new button to be used with an ActionRow or a message
-
success
static Button success(String customId, String label, Emoji emoji)
Create a new button with the green success style and the given properties. This is a convenience shorthand method.- Parameters:
customId- The custom id for this button.label- The label for this button.emoji- The emoji for this button.- Returns:
- the new button to be used with an ActionRow or a message
-
success
static Button success(String customId, String label, String unicodeEmoji)
Create a new button with the green success style and the given properties. This is a convenience shorthand method.- Parameters:
customId- The custom id for this button.label- The label for this button.unicodeEmoji- The emoji for this button.- Returns:
- the new button to be used with an ActionRow or a message
-
success
static Button success(String customId, Emoji emoji)
Create a new button with the green success style and the given emoji. If you only want to use an unicode emoji, usesuccess(String, String, String)instead and passnullas your label. This is a convenience shorthand method.- Parameters:
customId- The custom id for this button.emoji- The emoji for this button.- Returns:
- the new button to be used with an ActionRow or a message
-
link
static Button link(String url, String label)
Create a new button for a link button. This is a convenience shorthand method.- Parameters:
url- The url for this link button.label- The label for this button.- Returns:
- the new button to be used with an ActionRow or a message
-
link
static Button link(String url, String label, Emoji emoji)
Create a new button for a link button. This is a convenience shorthand method.- Parameters:
url- The url for this link button.label- The label for this button.emoji- The emoji for this button.- Returns:
- the new button to be used with an ActionRow or a message
-
link
static Button link(String url, String label, String unicodeEmoji)
Create a new button for a link button. This is a convenience shorthand method.- Parameters:
url- The url for this link button.label- The label for this button.unicodeEmoji- The emoji for this button.- Returns:
- the new button to be used with an ActionRow or a message
-
link
static Button link(String url, Emoji emoji)
Create a new button for a link button. If you only want to use an unicode emoji, uselink(String, String, String)instead and passnullas your label. This is a convenience shorthand method.- Parameters:
url- The url for this link button.emoji- The emoji for this button.- Returns:
- the new button to be used with an ActionRow or a message
-
create
static Button create(String customId, ButtonStyle style, String label)
Create a new button with the given properties. This is a convenience shorthand method.- Parameters:
customId- The custom id for this button.style- The button style for this button.label- The label for this button.- Returns:
- the new button to be used with an ActionRow or a message
-
create
static Button create(String customId, ButtonStyle style, String label, Emoji emoji)
Create a new button with the given properties. This is a convenience shorthand method.- Parameters:
customId- The custom id for this button.style- The button style for this button.label- The label for this button.emoji- The emoji for this button.- Returns:
- the new button to be used with an ActionRow or a message
-
create
static Button create(String customId, ButtonStyle style, String label, String unicodeEmoji)
Create a new button with the given properties. This is a convenience shorthand method.- Parameters:
customId- The custom id for this button.style- The button style for this button.label- The label for this button.unicodeEmoji- The unicode emoji for this button.- Returns:
- the new button to be used with an ActionRow or a message
-
create
static Button create(String customId, ButtonStyle style, Emoji emoji)
Create a new button with the given properties. This is a convenience shorthand method.- Parameters:
customId- The custom id for this button.style- The button style for this button.emoji- The emoji for this button.- Returns:
- the new button to be used with an ActionRow or a message
-
-