Skip to content

MessageButton

MessageButton

A class representing a message button.

Kind: global class

new MessageButton([data])

Creates a new message button instance.

ParamTypeDescription
[data]ObjectThe data to initialize the message button with.

messageButton.setLabel(label) ⇒ MessageButton

Sets the label of the button.

Kind: instance method of MessageButton
Returns: MessageButton - The message button instance.

ParamTypeDescription
labelstringThe label to set.

messageButton.setCustomId(customId) ⇒ MessageButton

Sets the custom ID of the button.

Kind: instance method of MessageButton
Returns: MessageButton - The message button instance.

ParamTypeDescription
customIdstringThe custom ID to set.

messageButton.setDisabled(disabled) ⇒ MessageButton

Sets whether the button is disabled.

Kind: instance method of MessageButton
Returns: MessageButton - The message button instance.

ParamTypeDescription
disabledbooleanWhether the button is disabled.

messageButton.setStyle(style) ⇒ MessageButton

Sets the style of the button.

Kind: instance method of MessageButton
Returns: MessageButton - The message button instance.

ParamTypeDescription
stylestringThe style to set.

messageButton.setURL(url) ⇒ MessageButton

Sets the URL of the button.

Kind: instance method of MessageButton
Returns: MessageButton - The message button instance.

ParamTypeDescription
urlstringThe URL to set.

messageButton.setEmoji(emoji) ⇒ MessageButton

Sets the emoji of the button.

Kind: instance method of MessageButton
Returns: MessageButton - The message button instance.

ParamTypeDescription
emojistring | ObjectThe emoji to set.

messageButton.toJSON() ⇒ Object

Converts the message button instance to a JSON representation.

Kind: instance method of MessageButton
Returns: Object - The JSON representation of the message button.