Table of Contents

Constructor DiscordButtonComponent

Namespace
DSharpPlus.Entities
Assembly
DSharpPlus.dll

DiscordButtonComponent(DiscordButtonComponent)

Constucts a new button based on another button.

public DiscordButtonComponent(DiscordButtonComponent other)

Parameters

other DiscordButtonComponent

The button to copy.

DiscordButtonComponent(DiscordButtonStyle, string, string, bool, DiscordComponentEmoji)

Constructs a new button with the specified options.

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

Parameters

style DiscordButtonStyle

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.