From 97d3b0ee63cfd1122e35d63587d7eb32cbc6d309 Mon Sep 17 00:00:00 2001 From: quin lynch Date: Sun, 19 Sep 2021 12:04:45 -0300 Subject: [PATCH] Renamed SelectMenu to SelectMenuComponent --- .../Message Components/ComponentBuilder.cs | 22 +++++++++---------- .../{SelectMenu.cs => SelectMenuComponent.cs} | 4 ++-- .../Message Components/SelectMenuOption.cs | 2 +- .../API/Common/SelectMenuComponent.cs | 2 +- .../Entities/Messages/RestMessage.cs | 2 +- .../SocketMessageComponentData.cs | 2 +- .../Entities/Messages/SocketMessage.cs | 2 +- 7 files changed, 18 insertions(+), 18 deletions(-) rename src/Discord.Net.Core/Entities/Interactions/Message Components/{SelectMenu.cs => SelectMenuComponent.cs} (91%) 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 f91bdba36..07cc0b6ab 100644 --- a/src/Discord.Net.Core/Entities/Interactions/Message Components/ComponentBuilder.cs +++ b/src/Discord.Net.Core/Entities/Interactions/Message Components/ComponentBuilder.cs @@ -80,7 +80,7 @@ namespace Discord foreach (var cmp in actionRow.Components) AddComponent(cmp, row); break; - case SelectMenu menu: + case SelectMenuComponent menu: this.WithSelectMenu(menu.Placeholder, menu.CustomId, menu.Options.Select(x => new SelectMenuOptionBuilder(x.Label, x.Value, x.Description, x.Emote, x.Default)).ToList(), menu.Placeholder, menu.MinValues, menu.MaxValues, menu.Disabled, row); break; } @@ -595,22 +595,22 @@ namespace Discord } /// - /// Represents a class used to build 's. + /// Represents a class used to build 's. /// public class SelectMenuBuilder { /// - /// The max length of a . + /// The max length of a . /// public const int MaxPlaceholderLength = 100; /// - /// The maximum number of values for the and properties. + /// The maximum number of values for the and properties. /// public const int MaxValuesCount = 25; /// - /// The maximum number of options a can have. + /// The maximum number of options a can have. /// public const int MaxOptionCount = 25; @@ -709,9 +709,9 @@ namespace Discord public SelectMenuBuilder() { } /// - /// Creates a new instance of a from instance of . + /// Creates a new instance of a from instance of . /// - public SelectMenuBuilder(SelectMenu selectMenu) + public SelectMenuBuilder(SelectMenuComponent selectMenu) { this.Placeholder = selectMenu.Placeholder; this.CustomId = selectMenu.Placeholder; @@ -861,14 +861,14 @@ namespace Discord } /// - /// Builds a + /// Builds a /// - /// The newly built - public SelectMenu Build() + /// The newly built + public SelectMenuComponent Build() { var options = this.Options?.Select(x => x.Build()).ToList(); - return new SelectMenu(this.CustomId, options, this.Placeholder, this.MinValues, this.MaxValues, this.Disabled); + return new SelectMenuComponent(this.CustomId, options, this.Placeholder, this.MinValues, this.MaxValues, this.Disabled); } } diff --git a/src/Discord.Net.Core/Entities/Interactions/Message Components/SelectMenu.cs b/src/Discord.Net.Core/Entities/Interactions/Message Components/SelectMenuComponent.cs similarity index 91% rename from src/Discord.Net.Core/Entities/Interactions/Message Components/SelectMenu.cs rename to src/Discord.Net.Core/Entities/Interactions/Message Components/SelectMenuComponent.cs index 46e53e470..6ea4c07fe 100644 --- a/src/Discord.Net.Core/Entities/Interactions/Message Components/SelectMenu.cs +++ b/src/Discord.Net.Core/Entities/Interactions/Message Components/SelectMenuComponent.cs @@ -9,7 +9,7 @@ namespace Discord /// /// Represents a select menu component defined at /// - public class SelectMenu : IMessageComponent + public class SelectMenuComponent : IMessageComponent { /// public ComponentType Type => ComponentType.SelectMenu; @@ -59,7 +59,7 @@ namespace Discord this.MinValues, this.Disabled); - internal SelectMenu(string customId, List options, string placeholder, int minValues, int maxValues, bool disabled) + internal SelectMenuComponent(string customId, List options, string placeholder, int minValues, int maxValues, bool disabled) { this.CustomId = customId; this.Options = options; diff --git a/src/Discord.Net.Core/Entities/Interactions/Message Components/SelectMenuOption.cs b/src/Discord.Net.Core/Entities/Interactions/Message Components/SelectMenuOption.cs index 74da89cae..e5425971a 100644 --- a/src/Discord.Net.Core/Entities/Interactions/Message Components/SelectMenuOption.cs +++ b/src/Discord.Net.Core/Entities/Interactions/Message Components/SelectMenuOption.cs @@ -7,7 +7,7 @@ using System.Threading.Tasks; namespace Discord { /// - /// Represents a choice for a . + /// Represents a choice for a . /// public class SelectMenuOption { diff --git a/src/Discord.Net.Rest/API/Common/SelectMenuComponent.cs b/src/Discord.Net.Rest/API/Common/SelectMenuComponent.cs index 6de1d4a4d..f99b8aa7d 100644 --- a/src/Discord.Net.Rest/API/Common/SelectMenuComponent.cs +++ b/src/Discord.Net.Rest/API/Common/SelectMenuComponent.cs @@ -32,7 +32,7 @@ namespace Discord.API public SelectMenuComponent() { } - public SelectMenuComponent(Discord.SelectMenu component) + public SelectMenuComponent(Discord.SelectMenuComponent component) { this.Type = component.Type; this.CustomId = component.CustomId; diff --git a/src/Discord.Net.Rest/Entities/Messages/RestMessage.cs b/src/Discord.Net.Rest/Entities/Messages/RestMessage.cs index c13d72a75..09e262f00 100644 --- a/src/Discord.Net.Rest/Entities/Messages/RestMessage.cs +++ b/src/Discord.Net.Rest/Entities/Messages/RestMessage.cs @@ -163,7 +163,7 @@ namespace Discord.Rest case ComponentType.SelectMenu: { var parsed = (API.SelectMenuComponent)y; - return new SelectMenu( + return new SelectMenuComponent( parsed.CustomId, parsed.Options.Select(z => new SelectMenuOption( z.Label, diff --git a/src/Discord.Net.WebSocket/Entities/Interaction/Message Components/SocketMessageComponentData.cs b/src/Discord.Net.WebSocket/Entities/Interaction/Message Components/SocketMessageComponentData.cs index 45e688266..a24fd59ac 100644 --- a/src/Discord.Net.WebSocket/Entities/Interaction/Message Components/SocketMessageComponentData.cs +++ b/src/Discord.Net.WebSocket/Entities/Interaction/Message Components/SocketMessageComponentData.cs @@ -23,7 +23,7 @@ namespace Discord.WebSocket public ComponentType Type { get; } /// - /// The value(s) of a interaction response. + /// The value(s) of a interaction response. /// public IReadOnlyCollection Values { get; } diff --git a/src/Discord.Net.WebSocket/Entities/Messages/SocketMessage.cs b/src/Discord.Net.WebSocket/Entities/Messages/SocketMessage.cs index 167440069..20df3446e 100644 --- a/src/Discord.Net.WebSocket/Entities/Messages/SocketMessage.cs +++ b/src/Discord.Net.WebSocket/Entities/Messages/SocketMessage.cs @@ -198,7 +198,7 @@ namespace Discord.WebSocket case ComponentType.SelectMenu: { var parsed = (API.SelectMenuComponent)y; - return new SelectMenu( + return new SelectMenuComponent( parsed.CustomId, parsed.Options.Select(z => new SelectMenuOption( z.Label,