Table of Contents

Class DiscordButtonComponent

Namespace
DisCatSharp.Entities
Assembly
DisCatSharp.dll

Represents a button that can be pressed. Fires ComponentInteractionCreated event when pressed.

public sealed class DiscordButtonComponent : DiscordBaseButtonComponent
Inheritance
DiscordButtonComponent
Inherited Members

Constructors

DiscordButtonComponent(DiscordButtonComponent)

Constructs a new button based on another button.

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

Constructs a new button with the specified options.

Properties

CustomId

The custom Id of this button. This is sent back when a user presses it. Applies to buttons with Primary, Secondary, Success, and Danger styles. Link buttons use URLs and Premium buttons use SKU IDs instead of custom IDs.

Emoji

The emoji to add to the button. Can be used in conjunction with a label, or as standalone. Must be added if label is not specified.

Label

The text to apply to the button. If this is not specified Emoji becomes required.

Style

The style of the button.

Methods

Disable()

Disables this component.

Enable()

Enables this component if it was disabled before.

SetState(bool)

Enables or disables this component.

WithId(int)

Assigns a unique id to this component.