Table of Contents

Class ButtonProperties

Namespace
NetCord.Rest
Assembly
NetCord.dll
public class ButtonProperties : ICustomizableButtonProperties, IButtonProperties
Inheritance
ButtonProperties
Implements
Inherited Members

Constructors

ButtonProperties(string, EmojiProperties, ButtonStyle)

public ButtonProperties(string customId, EmojiProperties emoji, ButtonStyle style)

Parameters

customId string

Developer-defined identifier for the button (max 100 characters).

emoji EmojiProperties

Emoji that appears on the button.

style ButtonStyle

Style of the button.

ButtonProperties(string, string, ButtonStyle)

public ButtonProperties(string customId, string label, ButtonStyle style)

Parameters

customId string

Developer-defined identifier for the button (max 100 characters).

label string

Text that appears on the button (max 80 characters).

style ButtonStyle

Style of the button.

ButtonProperties(string, string, EmojiProperties, ButtonStyle)

public ButtonProperties(string customId, string label, EmojiProperties emoji, ButtonStyle style)

Parameters

customId string

Developer-defined identifier for the button (max 100 characters).

label string

Text that appears on the button (max 80 characters).

emoji EmojiProperties

Emoji that appears on the button.

style ButtonStyle

Style of the button.

Properties

ComponentType

Type of the component.

[JsonPropertyName("type")]
public ComponentType ComponentType { get; }

Property Value

ComponentType

CustomId

Developer-defined identifier for the button (max 100 characters).

[JsonPropertyName("custom_id")]
public string CustomId { get; set; }

Property Value

string

Disabled

Whether the button is disabled.

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
[JsonPropertyName("disabled")]
public bool Disabled { get; set; }

Property Value

bool

Emoji

Emoji that appears on the button.

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
[JsonPropertyName("emoji")]
public EmojiProperties? Emoji { get; set; }

Property Value

EmojiProperties

Label

Text that appears on the button (max 80 characters).

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
[JsonPropertyName("label")]
public string? Label { get; set; }

Property Value

string

Style

Style of the button.

[JsonPropertyName("style")]
public ButtonStyle Style { get; set; }

Property Value

ButtonStyle

Methods

WithCustomId(string)

Developer-defined identifier for the button (max 100 characters).

public ButtonProperties WithCustomId(string customId)

Parameters

customId string

Returns

ButtonProperties

WithDisabled(bool)

public ButtonProperties WithDisabled(bool disabled = true)

Parameters

disabled bool

Returns

ButtonProperties

WithEmoji(EmojiProperties?)

public ButtonProperties WithEmoji(EmojiProperties? emoji)

Parameters

emoji EmojiProperties

Returns

ButtonProperties

WithLabel(string?)

public ButtonProperties WithLabel(string? label)

Parameters

label string

Returns

ButtonProperties

WithStyle(ButtonStyle)

public ButtonProperties WithStyle(ButtonStyle style)

Parameters

style ButtonStyle

Returns

ButtonProperties