Interface Button
-
- All Superinterfaces:
Component,LowLevelComponent,Specializable<LowLevelComponent>
public interface Button extends LowLevelComponent
This interface represents a Button component.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static Buttoncreate(java.lang.String customId, ButtonStyle style, java.lang.String label)Create a new button with the given properties.static Buttoncreate(java.lang.String customId, ButtonStyle style, java.lang.String label, boolean disabled)Create a new button with the given properties.static Buttoncreate(java.lang.String customId, ButtonStyle style, java.lang.String label, java.lang.String unicodeEmoji)Create a new button with the given properties.static Buttoncreate(java.lang.String customId, ButtonStyle style, java.lang.String label, java.lang.String unicodeEmoji, boolean disabled)Create a new button with the given properties.static Buttoncreate(java.lang.String customId, ButtonStyle style, java.lang.String label, Emoji emoji)Create a new button with the given properties.static Buttoncreate(java.lang.String customId, ButtonStyle style, java.lang.String label, Emoji emoji, boolean disabled)Create a new button with the given properties.static Buttoncreate(java.lang.String customId, ButtonStyle style, Emoji emoji)Create a new button with the given properties.static Buttondanger(java.lang.String customId, java.lang.String label)Create a new button with the red danger style and the given properties.static Buttondanger(java.lang.String customId, java.lang.String label, boolean disabled)Create a new button with the red danger style and the given properties.static Buttondanger(java.lang.String customId, java.lang.String label, java.lang.String unicodeEmoji)Create a new button with the red danger style and the given properties.static Buttondanger(java.lang.String customId, java.lang.String label, java.lang.String unicodeEmoji, boolean disabled)Create a new button with the red danger style and the given properties.static Buttondanger(java.lang.String customId, java.lang.String label, Emoji emoji)Create a new button with the red danger style and the given properties.static Buttondanger(java.lang.String customId, java.lang.String label, Emoji emoji, boolean disabled)Create a new button with the red danger style and the given properties.static Buttondanger(java.lang.String customId, Emoji emoji)Create a new button with the red danger style and the given emoji.static Buttondanger(java.lang.String customId, Emoji emoji, boolean disabled)Create a new button with the red danger style and the given emoji.java.util.Optional<java.lang.String>getCustomId()Get the button's identifier.java.util.Optional<Emoji>getEmoji()Get the emoji button's emoji.java.util.Optional<java.lang.String>getLabel()Get the button's label.ButtonStylegetStyle()Get the button's style.java.util.Optional<java.lang.String>getUrl()Get the button's clickable URL.java.util.Optional<java.lang.Boolean>isDisabled()Get whether the button is disabled.static Buttonlink(java.lang.String url, java.lang.String label)Create a new button for a link button.static Buttonlink(java.lang.String url, java.lang.String label, boolean disabled)Create a new button for a link button.static Buttonlink(java.lang.String url, java.lang.String label, java.lang.String unicodeEmoji)Create a new button for a link button.static Buttonlink(java.lang.String url, java.lang.String label, java.lang.String unicodeEmoji, boolean disabled)Create a new button for a link button.static Buttonlink(java.lang.String url, java.lang.String label, Emoji emoji)Create a new button for a link button.static Buttonlink(java.lang.String url, java.lang.String label, Emoji emoji, boolean disabled)Create a new button for a link button.static Buttonlink(java.lang.String url, Emoji emoji)Create a new button for a link button.static Buttonlink(java.lang.String url, Emoji emoji, boolean disabled)Create a new button for a link button.static Buttonprimary(java.lang.String customId, java.lang.String label)Create a new button with the blurple primary style and the given properties.static Buttonprimary(java.lang.String customId, java.lang.String label, boolean disabled)Create a new button with the blurple primary style and the given properties.static Buttonprimary(java.lang.String customId, java.lang.String label, java.lang.String unicodeEmoji)Create a new button with the blurple primary style and the given properties.static Buttonprimary(java.lang.String customId, java.lang.String label, java.lang.String unicodeEmoji, boolean disabled)Create a new button with the blurple primary style and the given properties.static Buttonprimary(java.lang.String customId, java.lang.String label, Emoji emoji)Create a new button with the blurple primary style and the given properties.static Buttonprimary(java.lang.String customId, java.lang.String label, Emoji emoji, boolean disabled)Create a new button with the blurple primary style and the given properties.static Buttonprimary(java.lang.String customId, Emoji emoji)Create a new button with the blurple primary style and the given emoji.static Buttonprimary(java.lang.String customId, Emoji emoji, boolean disabled)Create a new button with the blurple primary style and the given emoji.static Buttonsecondary(java.lang.String customId, java.lang.String label)Create a new button with the grey secondary style and the given properties.static Buttonsecondary(java.lang.String customId, java.lang.String label, boolean disabled)Create a new button with the grey secondary style and the given properties.static Buttonsecondary(java.lang.String customId, java.lang.String label, java.lang.String unicodeEmoji)Create a new button with the grey secondary style and the given properties.static Buttonsecondary(java.lang.String customId, java.lang.String label, java.lang.String unicodeEmoji, boolean disabled)Create a new button with the grey secondary style and the given properties.static Buttonsecondary(java.lang.String customId, java.lang.String label, Emoji emoji)Create a new button with the grey secondary style and the given properties.static Buttonsecondary(java.lang.String customId, java.lang.String label, Emoji emoji, boolean disabled)Create a new button with the grey secondary style and the given properties.static Buttonsecondary(java.lang.String customId, Emoji emoji)Create a new button with the grey secondary style and the given emoji.static Buttonsecondary(java.lang.String customId, Emoji emoji, boolean disabled)Create a new button with the grey secondary style and the given emoji.static Buttonsuccess(java.lang.String customId, java.lang.String label)Create a new button with the green success style and the given properties.static Buttonsuccess(java.lang.String customId, java.lang.String label, boolean disabled)Create a new button with the green success style and the given properties.static Buttonsuccess(java.lang.String customId, java.lang.String label, java.lang.String unicodeEmoji)Create a new button with the green success style and the given properties.static Buttonsuccess(java.lang.String customId, java.lang.String label, java.lang.String unicodeEmoji, boolean disabled)Create a new button with the green success style and the given properties.static Buttonsuccess(java.lang.String customId, java.lang.String label, Emoji emoji)Create a new button with the green success style and the given properties.static Buttonsuccess(java.lang.String customId, java.lang.String label, Emoji emoji, boolean disabled)Create a new button with the green success style and the given properties.static Buttonsuccess(java.lang.String customId, Emoji emoji)Create a new button with the green success style and the given emoji.static Buttonsuccess(java.lang.String customId, Emoji emoji, boolean disabled)Create a new button with the green success style and the given emoji.-
Methods inherited from interface org.javacord.api.entity.message.component.LowLevelComponent
asButton, asSelectMenu, asTextInput, isButton, isSelectMenu, isTextInput
-
Methods inherited from interface org.javacord.api.util.Specializable
as
-
-
-
-
Method Detail
-
getStyle
ButtonStyle getStyle()
Get the button's style.- Returns:
- The button's style.
-
getCustomId
java.util.Optional<java.lang.String> getCustomId()
Get the button's identifier.- Returns:
- The button's custom identifier.
-
getLabel
java.util.Optional<java.lang.String> getLabel()
Get the button's label.- Returns:
- The button's label.
-
getUrl
java.util.Optional<java.lang.String> getUrl()
Get the button's clickable URL.- Returns:
- The button's URL.
-
isDisabled
java.util.Optional<java.lang.Boolean> isDisabled()
Get whether the button is disabled.- Returns:
- Whether the button is disabled.
-
getEmoji
java.util.Optional<Emoji> getEmoji()
Get the emoji button's emoji.- Returns:
- The emoji button's emoji.
-
danger
static Button danger(java.lang.String customId, java.lang.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(java.lang.String customId, java.lang.String label, boolean disabled)
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.disabled- Whether the button is disabled.- Returns:
- the new button to be used with an ActionRow or a message
-
danger
static Button danger(java.lang.String customId, java.lang.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(java.lang.String customId, java.lang.String label, Emoji emoji, boolean disabled)
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.disabled- Whether the button is disabled.- Returns:
- the new button to be used with an ActionRow or a message
-
danger
static Button danger(java.lang.String customId, java.lang.String label, java.lang.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(java.lang.String customId, java.lang.String label, java.lang.String unicodeEmoji, boolean disabled)
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.disabled- Whether the button is disabled.- Returns:
- the new button to be used with an ActionRow or a message
-
danger
static Button danger(java.lang.String customId, Emoji emoji)
Create a new button with the red danger style and the given emoji. If you want to use a 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
-
danger
static Button danger(java.lang.String customId, Emoji emoji, boolean disabled)
Create a new button with the red danger style and the given emoji. If you want to use a unicode emoji, usedanger(String, String, String, boolean)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.disabled- Whether the button is disabled.- Returns:
- the new button to be used with an ActionRow or a message
-
primary
static Button primary(java.lang.String customId, java.lang.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(java.lang.String customId, java.lang.String label, boolean disabled)
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.disabled- Whether the button is disabled.- Returns:
- the new button to be used with an ActionRow or a message
-
primary
static Button primary(java.lang.String customId, java.lang.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(java.lang.String customId, java.lang.String label, Emoji emoji, boolean disabled)
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.disabled- Whether the button is disabled.- Returns:
- the new button to be used with an ActionRow or a message
-
primary
static Button primary(java.lang.String customId, java.lang.String label, java.lang.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(java.lang.String customId, java.lang.String label, java.lang.String unicodeEmoji, boolean disabled)
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.disabled- Whether the button is disabled.- Returns:
- the new button to be used with an ActionRow or a message
-
primary
static Button primary(java.lang.String customId, Emoji emoji)
Create a new button with the blurple primary style and the given emoji. If you want to use a 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
-
primary
static Button primary(java.lang.String customId, Emoji emoji, boolean disabled)
Create a new button with the blurple primary style and the given emoji. If you want to use a unicode emoji, useprimary(String, String, String, boolean)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.disabled- Whether the button is disabled.- Returns:
- the new button to be used with an ActionRow or a message
-
secondary
static Button secondary(java.lang.String customId, java.lang.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(java.lang.String customId, java.lang.String label, boolean disabled)
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.disabled- Whether the button is disabled.- Returns:
- the new button to be used with an ActionRow or a message
-
secondary
static Button secondary(java.lang.String customId, java.lang.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(java.lang.String customId, java.lang.String label, Emoji emoji, boolean disabled)
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.disabled- Whether the button is disabled.- Returns:
- the new button to be used with an ActionRow or a message
-
secondary
static Button secondary(java.lang.String customId, java.lang.String label, java.lang.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(java.lang.String customId, java.lang.String label, java.lang.String unicodeEmoji, boolean disabled)
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.disabled- Whether the button is disabled.- Returns:
- the new button to be used with an ActionRow or a message
-
secondary
static Button secondary(java.lang.String customId, Emoji emoji)
Create a new button with the grey secondary style and the given emoji. If you only want to use a 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
-
secondary
static Button secondary(java.lang.String customId, Emoji emoji, boolean disabled)
Create a new button with the grey secondary style and the given emoji. If you only want to use a unicode emoji, usesecondary(String, String, String, boolean)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.disabled- Whether the button is disabled.- Returns:
- the new button to be used with an ActionRow or a message
-
success
static Button success(java.lang.String customId, java.lang.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(java.lang.String customId, java.lang.String label, boolean disabled)
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.disabled- Whether the button is disabled.- Returns:
- the new button to be used with an ActionRow or a message
-
success
static Button success(java.lang.String customId, java.lang.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(java.lang.String customId, java.lang.String label, Emoji emoji, boolean disabled)
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.disabled- Whether the button is disabled.- Returns:
- the new button to be used with an ActionRow or a message
-
success
static Button success(java.lang.String customId, java.lang.String label, java.lang.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(java.lang.String customId, java.lang.String label, java.lang.String unicodeEmoji, boolean disabled)
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.disabled- Whether the button is disabled.- Returns:
- the new button to be used with an ActionRow or a message
-
success
static Button success(java.lang.String customId, Emoji emoji)
Create a new button with the green success style and the given emoji. If you only want to use a 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
-
success
static Button success(java.lang.String customId, Emoji emoji, boolean disabled)
Create a new button with the green success style and the given emoji. If you only want to use a unicode emoji, usesuccess(String, String, String, boolean)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.disabled- Whether the button is disabled.- Returns:
- the new button to be used with an ActionRow or a message
-
link
static Button link(java.lang.String url, java.lang.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(java.lang.String url, java.lang.String label, boolean disabled)
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.disabled- Whether the button is disabled.- Returns:
- the new button to be used with an ActionRow or a message
-
link
static Button link(java.lang.String url, java.lang.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(java.lang.String url, java.lang.String label, Emoji emoji, boolean disabled)
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.disabled- Whether the button is disabled.- Returns:
- the new button to be used with an ActionRow or a message
-
link
static Button link(java.lang.String url, java.lang.String label, java.lang.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(java.lang.String url, java.lang.String label, java.lang.String unicodeEmoji, boolean disabled)
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.disabled- Whether the button is disabled.- Returns:
- the new button to be used with an ActionRow or a message
-
link
static Button link(java.lang.String url, Emoji emoji)
Create a new button for a link button. If you only want to use a 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
-
link
static Button link(java.lang.String url, Emoji emoji, boolean disabled)
Create a new button for a link button. If you only want to use a unicode emoji, uselink(String, String, String, boolean)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.disabled- Whether the button is disabled.- Returns:
- the new button to be used with an ActionRow or a message
-
create
static Button create(java.lang.String customId, ButtonStyle style, java.lang.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(java.lang.String customId, ButtonStyle style, java.lang.String label, boolean disabled)
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.disabled- Whether the button is disabled.- Returns:
- the new button to be used with an ActionRow or a message
-
create
static Button create(java.lang.String customId, ButtonStyle style, java.lang.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(java.lang.String customId, ButtonStyle style, java.lang.String label, Emoji emoji, boolean disabled)
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.disabled- Whether the button is disabled.- Returns:
- the new button to be used with an ActionRow or a message
-
create
static Button create(java.lang.String customId, ButtonStyle style, java.lang.String label, java.lang.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(java.lang.String customId, ButtonStyle style, java.lang.String label, java.lang.String unicodeEmoji, boolean disabled)
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.disabled- Whether the button is disabled.- Returns:
- the new button to be used with an ActionRow or a message
-
create
static Button create(java.lang.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
-
-