From 28f8ac85ad67a07bd2f1c6f7bceceea340dfcae6 Mon Sep 17 00:00:00 2001 From: quin lynch Date: Thu, 7 Oct 2021 01:43:43 -0300 Subject: [PATCH] Update ButtonComponent summaries and boolean fields --- .../Message Components/ButtonComponent.cs | 22 +++++++++---------- .../Message Components/ComponentBuilder.cs | 4 ++-- .../API/Common/ButtonComponent.cs | 2 +- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/Discord.Net.Core/Entities/Interactions/Message Components/ButtonComponent.cs b/src/Discord.Net.Core/Entities/Interactions/Message Components/ButtonComponent.cs index bad9f8aa3..64a2ab0e9 100644 --- a/src/Discord.Net.Core/Entities/Interactions/Message Components/ButtonComponent.cs +++ b/src/Discord.Net.Core/Entities/Interactions/Message Components/ButtonComponent.cs @@ -16,27 +16,25 @@ namespace Discord public ComponentType Type { get; } = ComponentType.Button; /// - /// The of this button, example buttons with each style can be found Here. + /// Gets the of this button, example buttons with each style can be found Here. /// public ButtonStyle Style { get; } /// - /// The label of the button, this is the text that is shown. + /// Gets the label of the button, this is the text that is shown. /// public string Label { get; } /// - /// A that will be displayed with this button. + /// Gets the displayed with this button. /// public IEmote Emote { get; } - /// - /// A unique id that will be sent with a . This is how you know what button was pressed. - /// + /// public string CustomId { get; } /// - /// A URL for a button. + /// Gets the URL for a button. /// /// /// You cannot have a button with a URL and a CustomId. @@ -44,9 +42,9 @@ namespace Discord public string Url { get; } /// - /// Whether this button is disabled or not. + /// Gets whether this button is disabled or not. /// - public bool Disabled { get; } + public bool IsDisabled { get; } /// /// Turns this button into a button builder. @@ -55,16 +53,16 @@ namespace Discord /// A newly created button builder with the same properties as this button. /// public ButtonBuilder ToBuilder() - => new ButtonBuilder(Label, CustomId, Style, Url, Emote, Disabled); + => new ButtonBuilder(Label, CustomId, Style, Url, Emote, IsDisabled); - internal ButtonComponent(ButtonStyle style, string label, IEmote emote, string customId, string url, bool disabled) + internal ButtonComponent(ButtonStyle style, string label, IEmote emote, string customId, string url, bool isDisabled) { Style = style; Label = label; Emote = emote; CustomId = customId; Url = url; - Disabled = disabled; + IsDisabled = isDisabled; } } } diff --git a/src/Discord.Net.Core/Entities/Interactions/Message Components/ComponentBuilder.cs b/src/Discord.Net.Core/Entities/Interactions/Message Components/ComponentBuilder.cs index 1fde8c7d7..91cce1597 100644 --- a/src/Discord.Net.Core/Entities/Interactions/Message Components/ComponentBuilder.cs +++ b/src/Discord.Net.Core/Entities/Interactions/Message Components/ComponentBuilder.cs @@ -69,7 +69,7 @@ namespace Discord switch (component) { case ButtonComponent button: - WithButton(button.Label, button.CustomId, button.Style, button.Emote, button.Url, button.Disabled, row); + WithButton(button.Label, button.CustomId, button.Style, button.Emote, button.Url, button.IsDisabled, row); break; case ActionRowComponent actionRow: foreach (var cmp in actionRow.Components) @@ -451,7 +451,7 @@ namespace Discord Style = button.Style; Url = button.Url; Label = button.Label; - IsDisabled = button.Disabled; + IsDisabled = button.IsDisabled; Emote = button.Emote; } diff --git a/src/Discord.Net.Rest/API/Common/ButtonComponent.cs b/src/Discord.Net.Rest/API/Common/ButtonComponent.cs index b941bf593..887040006 100644 --- a/src/Discord.Net.Rest/API/Common/ButtonComponent.cs +++ b/src/Discord.Net.Rest/API/Common/ButtonComponent.cs @@ -39,7 +39,7 @@ namespace Discord.API Label = c.Label; CustomId = c.CustomId; Url = c.Url; - Disabled = c.Disabled; + Disabled = c.IsDisabled; if (c.Emote != null) {