Table of Contents

Class ButtonComponent

Namespace
Discord
Assembly
Discord.Net.Core.dll

Represents a IMessageComponent Button.

public class ButtonComponent : IMessageComponent
Inheritance
ButtonComponent
Implements
Inherited Members

Properties

CustomId

Gets the custom id of the component if possible; otherwise null.

public string CustomId { get; }

Property Value

string

Emote

Gets the IEmote displayed with this button.

public IEmote Emote { get; }

Property Value

IEmote

IsDisabled

Gets whether this button is disabled or not.

public bool IsDisabled { get; }

Property Value

bool

Label

Gets the label of the button, this is the text that is shown.

public string Label { get; }

Property Value

string

Style

Gets the ButtonStyle of this button, example buttons with each style can be found Here.

public ButtonStyle Style { get; }

Property Value

ButtonStyle

Type

Gets the ComponentType of this Message Component.

public ComponentType Type { get; }

Property Value

ComponentType

Url

Gets the URL for a Link button.

public string Url { get; }

Property Value

string

Remarks

You cannot have a button with a URL and a CustomId.

Methods

ToBuilder()

Turns this button into a button builder.

public ButtonBuilder ToBuilder()

Returns

ButtonBuilder

A newly created button builder with the same properties as this button.