Skip to main content

Class ButtonComponent

Represents a Discord.IMessageComponent Button.

Assembly: Discord.Net.Core.dll​
View Source​
Declaration
public class ButtonComponent : IMessageComponent

Properties​

Type​

Gets the Discord.ComponentType of this Message Component.

View Source​
Declaration
public ComponentType Type { get; }

Style​

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

View Source​
Declaration
public ButtonStyle Style { get; }

Label​

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

View Source​
Declaration
public string Label { get; }

Emote​

Gets the Discord.IEmote displayed with this button.

View Source​
Declaration
public IEmote Emote { get; }

CustomId​

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

View Source​
Declaration
public string CustomId { get; }

Url​

Gets the URL for a Discord.ButtonStyle.Link button.

View Source​
Declaration
public string Url { get; }

IsDisabled​

Gets whether this button is disabled or not.

View Source​
Declaration
public bool IsDisabled { get; }

Methods​

ToBuilder()​

Turns this button into a button builder.

View Source​
Declaration
public ButtonBuilder ToBuilder()
Returns​

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

Implements​