Class ButtonProperties
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
stringDeveloper-defined identifier for the button (max 100 characters).
emoji
EmojiPropertiesEmoji that appears on the button.
style
ButtonStyleStyle of the button.
ButtonProperties(string, string, ButtonStyle)
public ButtonProperties(string customId, string label, ButtonStyle style)
Parameters
customId
stringDeveloper-defined identifier for the button (max 100 characters).
label
stringText that appears on the button (max 80 characters).
style
ButtonStyleStyle of the button.
ButtonProperties(string, string, EmojiProperties, ButtonStyle)
public ButtonProperties(string customId, string label, EmojiProperties emoji, ButtonStyle style)
Parameters
customId
stringDeveloper-defined identifier for the button (max 100 characters).
label
stringText that appears on the button (max 80 characters).
emoji
EmojiPropertiesEmoji that appears on the button.
style
ButtonStyleStyle of the button.
Properties
ComponentType
Type of the component.
[JsonPropertyName("type")]
public ComponentType ComponentType { get; }
Property Value
CustomId
Developer-defined identifier for the button (max 100 characters).
[JsonPropertyName("custom_id")]
public string CustomId { get; set; }
Property Value
Disabled
Whether the button is disabled.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
[JsonPropertyName("disabled")]
public bool Disabled { get; set; }
Property Value
Emoji
Emoji that appears on the button.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
[JsonPropertyName("emoji")]
public EmojiProperties? Emoji { get; set; }
Property Value
Label
Text that appears on the button (max 80 characters).
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
[JsonPropertyName("label")]
public string? Label { get; set; }
Property Value
Style
Style of the button.
[JsonPropertyName("style")]
public ButtonStyle Style { get; set; }
Property Value
Methods
WithCustomId(string)
Developer-defined identifier for the button (max 100 characters).
public ButtonProperties WithCustomId(string customId)
Parameters
customId
string
Returns
WithDisabled(bool)
public ButtonProperties WithDisabled(bool disabled = true)
Parameters
disabled
bool
Returns
WithEmoji(EmojiProperties?)
public ButtonProperties WithEmoji(EmojiProperties? emoji)
Parameters
emoji
EmojiProperties
Returns
WithLabel(string?)
public ButtonProperties WithLabel(string? label)
Parameters
label
string
Returns
WithStyle(ButtonStyle)
public ButtonProperties WithStyle(ButtonStyle style)
Parameters
style
ButtonStyle