MessageButtonBuilder¶
Inherits: MessageComponentBuilder < Reference < Object
Description¶
Helper class to build message buttons.
- Buttons must be sent inside an Action Row.
- An Action Row can contain up to 5 buttons.
- An Action Row containing buttons cannot also contain a select menu.
Methods¶
return type | signature |
---|---|
MessageButtonBuilder | with_label ( String label ) |
MessageButtonBuilder | with_custom_id ( String custom_id ) |
MessageButtonBuilder | with_url ( String url ) |
MessageButtonBuilder | disabled ( bool value ) |
Constants¶
-
int LABEL_MAX_LENGTH = 80
Maximum number of characters in a button label.
Method Descriptions¶
-
MessageButtonBuilder MessageButtonBuilder ( int style )
Constructs a new
MessageButtonBuilder
instance.style
takes aMessageButton.Styles
value.
-
MessageButtonBuilder with_label ( String label )
Sets the button's label.
-
MessageButtonBuilder with_custom_id ( String custom_id )
Sets the message identifier. Can not be specified if the message
style
isMessageButton.Styles.LINK
.
-
MessageButtonBuilder with_url ( String url )
Sets the message URL. Can not be specified if the message
style
is notMessageButton.Styles.LINK
.
-
MessageButtonBuilder disabled ( bool value )
Disables the button.