Table of Contents

Constructor DiscordButtonComponent

Namespace
DisCatSharp.Entities
Assembly
DisCatSharp.dll

DiscordButtonComponent(DiscordButtonComponent)

Constructs a new button based on another button.

public DiscordButtonComponent(DiscordButtonComponent other)

Parameters

other DiscordButtonComponent

The button to copy.

DiscordButtonComponent(ButtonStyle, string, string, bool, DiscordComponentEmoji)

Constructs a new button with the specified options.

public DiscordButtonComponent(ButtonStyle style, string customId = null, string label = null, bool disabled = false, DiscordComponentEmoji emoji = null)

Parameters

style ButtonStyle

The style/color of the button.

customId string

The Id to assign to the button. This is sent back when a user presses it.

label string

The text to display on the button, up to 80 characters. Can be left blank if emojiis set.

disabled bool

Whether this button should be initialized as being disabled. User sees a greyed out button that cannot be interacted with.

emoji DiscordComponentEmoji

The emoji to add to the button. This is required if label is empty or null.

Exceptions

ArgumentException

Is thrown when neither the emoji nor the label is set.