Skip to content

ButtonBuilder

ButtonBuilder is used to construct a button component for a Discord message.

Properties

Style

ButtonBuilder.Style  :: table

An enumeration of button styles.

  • Blurple: 1
  • Grey: 2
  • Green: 3
  • Red: 4
  • Link: 5

Methods

setStyle

ButtonBuilder : setStyle (

     buttonStyle: number
)  -> Builders.Interface.ButtonBuilder

Sets the style of the button.

setLabel

ButtonBuilder : setLabel (

     buttonLabel: string
)  -> Builders.Interface.ButtonBuilder

Sets the label of the button.

setEmoji

ButtonBuilder : setEmoji (

     emojiId: string
     emojiName: string
)  -> Builders.Interface.ButtonBuilder

Sets the emoji for the button.

setLinkUrl

ButtonBuilder : setLinkUrl (

     url: string
)  -> Builders.Interface.ButtonBuilder

Sets the URL for the button. This should only be used if the button style is set to Link.

setDisabled

ButtonBuilder : setDisabled (

     isDisabled: boolean
)  -> Builders.Interface.ButtonBuilder

Sets whether the button is disabled.

toPayloadObject

ButtonBuilder : toPayloadObject ()  -> Network.Resolvable

Converts the button to a JSON object that can be sent to the Discord API.

Functions

new

ButtonBuilder . new (

     buttonId: string
)  -> ()

Creates a new instance of ButtonBuilder.