Constructor DiscordButtonComponent
- Namespace
- DisCatSharp.Entities
- Assembly
- DisCatSharp.dll
DiscordButtonComponent(DiscordButtonComponent)
Constructs a new button based on another button.
public DiscordButtonComponent(DiscordButtonComponent other)
Parameters
other
DiscordButtonComponentThe button to copy.
DiscordButtonComponent(ButtonStyle, string, string, bool, DiscordComponentEmoji)
Constructs a new button with the specified options.
public DiscordButtonComponent(ButtonStyle style, string customId = null, string label = null, bool disabled = false, DiscordComponentEmoji emoji = null)
Parameters
style
ButtonStyleThe style/color of the button.
customId
stringThe Id to assign to the button. This is sent back when a user presses it.
label
stringThe text to display on the button, up to 80 characters. Can be left blank if
emoji
is set.disabled
boolWhether this button should be initialized as being disabled. User sees a greyed out button that cannot be interacted with.
emoji
DiscordComponentEmojiThe emoji to add to the button. This is required if
label
is empty or null.
Exceptions
- ArgumentException
Is thrown when neither the
emoji
nor thelabel
is set.