From 06eefa790c688fc7793ca07aa6f8e483c411cdf4 Mon Sep 17 00:00:00 2001 From: quin lynch Date: Sat, 9 Oct 2021 02:36:28 -0300 Subject: [PATCH] Refactor summaries and boolean property names --- src/Discord.Net.Core/Discord.Net.Core.xml | 115 ++++++++---------- .../Entities/Channels/IStageChannel.cs | 12 +- .../Entities/Channels/IThreadChannel.cs | 18 +-- .../Entities/Guilds/IGuild.cs | 8 +- .../Context Menus/MessageCommandBuilder.cs | 14 +-- .../Context Menus/UserCommandBuilder.cs | 16 +-- .../Message Components/ActionRowComponent.cs | 2 +- .../Message Components/ButtonComponent.cs | 22 ++-- .../Message Components/ComponentBuilder.cs | 67 +++++----- .../Message Components/MessageComponent.cs | 2 +- .../Message Components/SelectMenuComponent.cs | 20 ++- .../API/Common/ButtonComponent.cs | 2 +- .../API/Common/SelectMenuComponent.cs | 2 +- src/Discord.Net.Rest/Discord.Net.Rest.xml | 10 +- .../Entities/Channels/RestStageChannel.cs | 10 +- .../Entities/Channels/RestThreadChannel.cs | 12 +- .../Discord.Net.WebSocket.xml | 10 +- .../Entities/Channels/SocketStageChannel.cs | 10 +- .../Entities/Channels/SocketThreadChannel.cs | 12 +- 19 files changed, 175 insertions(+), 189 deletions(-) diff --git a/src/Discord.Net.Core/Discord.Net.Core.xml b/src/Discord.Net.Core/Discord.Net.Core.xml index ebbf93c39..a12881481 100644 --- a/src/Discord.Net.Core/Discord.Net.Core.xml +++ b/src/Discord.Net.Core/Discord.Net.Core.xml @@ -1988,23 +1988,21 @@ The of the current stage. + Gets the of the current stage. If the stage isn't live then this property will be set to . - + - if stage discovery is disabled, otherwise . + Gets whether or not stage discovery is disabled. - + - when the stage is live, otherwise . + Gets whether or not the stage is live. - - If the stage isn't live then this property will be set to . - @@ -2238,39 +2236,39 @@ Gets the type of the current thread channel. - + - if the current user has joined this thread, otherwise . + Gets whether or not the current user has joined this thread. - + if the current thread is archived, otherwise . - Duration to automatically archive the thread after recent activity. + Gets whether or not the current thread is archived. - Timestamp when the thread's archive status was last changed, used for calculating recent activity. + Gets the timestamp when the thread's archive status was last changed, used for calculating recent activity. - + - if the current thread is locked, otherwise + Gets whether or not the current thread is locked. - An approximate count of users in a thread, stops counting at 50. + Gets an approximate count of users in a thread, stops counting after 50. - An approximate count of messages in a thread, stops counting at 50. + Gets an approximate count of messages in a thread, stops counting after 50. @@ -3537,7 +3535,7 @@ - Gets a stage channel in this guild + Gets a stage channel in this guild. The snowflake identifier for the stage channel. The that determines whether the object should be fetched from cache. @@ -3782,7 +3780,7 @@ - Disconnects the user from its current voice channel + Disconnects the user from its current voice channel. The user to disconnect. A task that represents the asynchronous operation for disconnecting a user. @@ -4009,7 +4007,7 @@ - Creates a new sticker in this guild + Creates a new sticker in this guild. The name of the sticker. The description of the sticker. @@ -4022,7 +4020,7 @@ - Creates a new sticker in this guild + Creates a new sticker in this guild. The name of the sticker. The description of the sticker. @@ -4766,12 +4764,12 @@ - The name of this Message command. + Gets or sets the name of this Message command. - + - Whether the command is enabled by default when the app is added to a guild + Gets or sets whether the command is enabled by default when the app is added to a guild @@ -4795,7 +4793,7 @@ Sets the default permission of the current command. - The default permission value to set. + The default permission value to set. The current builder. @@ -4810,17 +4808,17 @@ - Returns the maximum length a commands name allowed by Discord + Returns the maximum length a commands name allowed by Discord. - The name of this User command. + Gets or sets the name of this User command. - + - Whether the command is enabled by default when the app is added to a guild + Gets or sets whether the command is enabled by default when the app is added to a guild. @@ -4842,7 +4840,7 @@ Sets the default permission of the current command. - The default permission value to set. + The default permission value to set. The current builder. @@ -5191,7 +5189,7 @@ - The child components in this row. + Gets the child components in this row. @@ -5204,35 +5202,33 @@ - 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. - 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. - A that will be displayed with this button. + Gets the displayed with this button. - - A unique id that will be sent with a . This is how you know what button was pressed. - + - A URL for a button. + Gets the URL for a button. You cannot have a button with a URL and a CustomId. - + - Whether this button is disabled or not. + Gets whether this button is disabled or not. @@ -5309,12 +5305,11 @@ The components to create the builder from. The newly created builder. - + Adds a to the at the specific row. If the row cannot accept the component then it will add it to a row that can. - The label of the menu. The custom id of the menu. The options of the menu. The placeholder of the menu. @@ -5444,7 +5439,7 @@ Gets or sets the url of the current button. - + Gets or sets whether the current button is disabled. @@ -5463,7 +5458,7 @@ The custom ID of this button. The custom ID of this button. The emote of this button. - Disabled this button or not. + Disabled this button or not. @@ -5556,7 +5551,7 @@ Sets whether the current button is disabled. - Whether the current button is disabled or not. + Whether the current button is disabled or not. The current builder. @@ -5623,7 +5618,7 @@ count exceeds . is null. - + Gets or sets whether the current menu is disabled. @@ -5647,7 +5642,7 @@ The placeholder of this select menu. The max values of this select menu. The min values of this select menu. - Disabled this select menu or not. + Disabled this select menu or not. @@ -5717,7 +5712,7 @@ The value of this option. The description of this option. The emote of this option. - Render this option as selected by default or not. + Render this option as selected by default or not. Options count reached . The current builder. @@ -5727,7 +5722,7 @@ Sets whether the current menu is disabled. - Whether the current menu is disabled or not. + Whether the current menu is disabled or not. The current builder. @@ -5784,7 +5779,7 @@ Gets or sets the emote of this option. - + Gets or sets the whether or not this option will render selected by default. @@ -5802,7 +5797,7 @@ The value of this option. The description of this option. The emote of this option. - Render this option as selected by default or not. + Render this option as selected by default or not. @@ -5852,7 +5847,7 @@ Sets the field default. - The value to set the field default to. + The value to set the field default to. The current builder. @@ -5905,7 +5900,7 @@ - The components to be used in a message. + Gets the components to be used in a message. @@ -5922,33 +5917,31 @@ - - The custom id of this Select menu that will be sent with a . - + - The menus options to select from. + Gets the menus options to select from. - A custom placeholder text if nothing is selected, max 100 characters. + Gets the custom placeholder text if nothing is selected. - The minimum number of items that must be chosen; default 1, min 0, max 25 + Gets the minimum number of items that must be chosen. - The maximum number of items that can be chosen; default 1, max 25 + Gets the maximum number of items that can be chosen. - + - Whether this menu is disabled or not. + Gets whether this menu is disabled or not. diff --git a/src/Discord.Net.Core/Entities/Channels/IStageChannel.cs b/src/Discord.Net.Core/Entities/Channels/IStageChannel.cs index 9e417a4f1..9c6d9e187 100644 --- a/src/Discord.Net.Core/Entities/Channels/IStageChannel.cs +++ b/src/Discord.Net.Core/Entities/Channels/IStageChannel.cs @@ -21,6 +21,7 @@ namespace Discord /// /// The of the current stage. + /// Gets the of the current stage. /// /// /// If the stage isn't live then this property will be set to . @@ -28,17 +29,14 @@ namespace Discord StagePrivacyLevel? PrivacyLevel { get; } /// - /// if stage discovery is disabled, otherwise . + /// Gets whether or not stage discovery is disabled. /// - bool? DiscoverableDisabled { get; } + bool? IsDiscoverableDisabled { get; } /// - /// when the stage is live, otherwise . + /// Gets whether or not the stage is live. /// - /// - /// If the stage isn't live then this property will be set to . - /// - bool Live { get; } + bool IsLive { get; } /// /// Starts the stage, creating a stage instance. diff --git a/src/Discord.Net.Core/Entities/Channels/IThreadChannel.cs b/src/Discord.Net.Core/Entities/Channels/IThreadChannel.cs index b5d6eea20..dfafb313d 100644 --- a/src/Discord.Net.Core/Entities/Channels/IThreadChannel.cs +++ b/src/Discord.Net.Core/Entities/Channels/IThreadChannel.cs @@ -17,37 +17,37 @@ namespace Discord ThreadType Type { get; } /// - /// if the current user has joined this thread, otherwise . + /// Gets whether or not the current user has joined this thread. /// - bool Joined { get; } + bool HasJoined { get; } /// /// if the current thread is archived, otherwise . /// - bool Archived { get; } + bool IsArchived { get; } /// - /// Duration to automatically archive the thread after recent activity. + /// Gets whether or not the current thread is archived. /// ThreadArchiveDuration AutoArchiveDuration { get; } /// - /// Timestamp when the thread's archive status was last changed, used for calculating recent activity. + /// Gets the timestamp when the thread's archive status was last changed, used for calculating recent activity. /// DateTimeOffset ArchiveTimestamp { get; } /// - /// if the current thread is locked, otherwise + /// Gets whether or not the current thread is locked. /// - bool Locked { get; } + bool IsLocked { get; } /// - /// An approximate count of users in a thread, stops counting at 50. + /// Gets an approximate count of users in a thread, stops counting after 50. /// int MemberCount { get; } /// - /// An approximate count of messages in a thread, stops counting at 50. + /// Gets an approximate count of messages in a thread, stops counting after 50. /// int MessageCount { get; } diff --git a/src/Discord.Net.Core/Entities/Guilds/IGuild.cs b/src/Discord.Net.Core/Entities/Guilds/IGuild.cs index 275879a2c..4a2333645 100644 --- a/src/Discord.Net.Core/Entities/Guilds/IGuild.cs +++ b/src/Discord.Net.Core/Entities/Guilds/IGuild.cs @@ -538,7 +538,7 @@ namespace Discord /// Task GetVoiceChannelAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); /// - /// Gets a stage channel in this guild + /// Gets a stage channel in this guild. /// /// The snowflake identifier for the stage channel. /// The that determines whether the object should be fetched from cache. @@ -771,7 +771,7 @@ namespace Discord /// A guild user associated with the specified ; if the user is already in the guild. Task AddGuildUserAsync(ulong userId, string accessToken, Action func = null, RequestOptions options = null); /// - /// Disconnects the user from its current voice channel + /// Disconnects the user from its current voice channel. /// /// The user to disconnect. /// A task that represents the asynchronous operation for disconnecting a user. @@ -990,7 +990,7 @@ namespace Discord Task CreateStickerAsync(string name, string description, IEnumerable tags, Image image, RequestOptions options = null); /// - /// Creates a new sticker in this guild + /// Creates a new sticker in this guild. /// /// The name of the sticker. /// The description of the sticker. @@ -1003,7 +1003,7 @@ namespace Discord Task CreateStickerAsync(string name, string description, IEnumerable tags, string path, RequestOptions options = null); /// - /// Creates a new sticker in this guild + /// Creates a new sticker in this guild. /// /// The name of the sticker. /// The description of the sticker. diff --git a/src/Discord.Net.Core/Entities/Interactions/Context Menus/MessageCommandBuilder.cs b/src/Discord.Net.Core/Entities/Interactions/Context Menus/MessageCommandBuilder.cs index c6433e969..07d8bcfbf 100644 --- a/src/Discord.Net.Core/Entities/Interactions/Context Menus/MessageCommandBuilder.cs +++ b/src/Discord.Net.Core/Entities/Interactions/Context Menus/MessageCommandBuilder.cs @@ -18,7 +18,7 @@ namespace Discord public const int MaxNameLength = 32; /// - /// The name of this Message command. + /// Gets or sets the name of this Message command. /// public string Name { @@ -37,9 +37,9 @@ namespace Discord } /// - /// Whether the command is enabled by default when the app is added to a guild + /// Gets or sets whether the command is enabled by default when the app is added to a guild /// - public bool DefaultPermission { get; set; } = true; + public bool IsDefaultPermission { get; set; } = true; private string _name { get; set; } @@ -54,7 +54,7 @@ namespace Discord MessageCommandProperties props = new MessageCommandProperties() { Name = Name, - DefaultPermission = DefaultPermission + DefaultPermission = IsDefaultPermission }; return props; @@ -77,11 +77,11 @@ namespace Discord /// /// Sets the default permission of the current command. /// - /// The default permission value to set. + /// The default permission value to set. /// The current builder. - public MessageCommandBuilder WithDefaultPermission (bool value) + public MessageCommandBuilder WithDefaultPermission (bool isDefaultPermission) { - DefaultPermission = value; + IsDefaultPermission = isDefaultPermission; return this; } } diff --git a/src/Discord.Net.Core/Entities/Interactions/Context Menus/UserCommandBuilder.cs b/src/Discord.Net.Core/Entities/Interactions/Context Menus/UserCommandBuilder.cs index 797437476..2cc0da4bd 100644 --- a/src/Discord.Net.Core/Entities/Interactions/Context Menus/UserCommandBuilder.cs +++ b/src/Discord.Net.Core/Entities/Interactions/Context Menus/UserCommandBuilder.cs @@ -13,12 +13,12 @@ namespace Discord public class UserCommandBuilder { /// - /// Returns the maximum length a commands name allowed by Discord + /// Returns the maximum length a commands name allowed by Discord. /// public const int MaxNameLength = 32; /// - /// The name of this User command. + /// Gets or sets the name of this User command. /// public string Name { @@ -37,9 +37,9 @@ namespace Discord } /// - /// Whether the command is enabled by default when the app is added to a guild + /// Gets or sets whether the command is enabled by default when the app is added to a guild. /// - public bool DefaultPermission { get; set; } = true; + public bool IsDefaultPermission { get; set; } = true; private string _name { get; set; } @@ -52,7 +52,7 @@ namespace Discord UserCommandProperties props = new UserCommandProperties() { Name = Name, - DefaultPermission = DefaultPermission + DefaultPermission = IsDefaultPermission }; return props; @@ -75,11 +75,11 @@ namespace Discord /// /// Sets the default permission of the current command. /// - /// The default permission value to set. + /// The default permission value to set. /// The current builder. - public UserCommandBuilder WithDefaultPermission (bool value) + public UserCommandBuilder WithDefaultPermission (bool isDefaultPermission) { - DefaultPermission = value; + IsDefaultPermission = isDefaultPermission; return this; } } diff --git a/src/Discord.Net.Core/Entities/Interactions/Message Components/ActionRowComponent.cs b/src/Discord.Net.Core/Entities/Interactions/Message Components/ActionRowComponent.cs index a9dd27bea..df08e5ee3 100644 --- a/src/Discord.Net.Core/Entities/Interactions/Message Components/ActionRowComponent.cs +++ b/src/Discord.Net.Core/Entities/Interactions/Message Components/ActionRowComponent.cs @@ -16,7 +16,7 @@ namespace Discord public ComponentType Type { get; } = ComponentType.ActionRow; /// - /// The child components in this row. + /// Gets the child components in this row. /// public IReadOnlyCollection Components { get; internal set; } 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 975363f58..4db96d409 100644 --- a/src/Discord.Net.Core/Entities/Interactions/Message Components/ComponentBuilder.cs +++ b/src/Discord.Net.Core/Entities/Interactions/Message Components/ComponentBuilder.cs @@ -69,14 +69,14 @@ 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) AddComponent(cmp, row); break; case SelectMenuComponent menu: - 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); + WithSelectMenu(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.IsDisabled, row); break; } } @@ -85,7 +85,6 @@ namespace Discord /// Adds a to the at the specific row. /// If the row cannot accept the component then it will add it to a row that can. /// - /// The label of the menu. /// The custom id of the menu. /// The options of the menu. /// The placeholder of the menu. @@ -94,7 +93,7 @@ namespace Discord /// Whether or not the menu is disabled. /// The row to add the menu to. /// - public ComponentBuilder WithSelectMenu(string label, string customId, List options, + public ComponentBuilder WithSelectMenu(string customId, List options, string placeholder = null, int minValues = 1, int maxValues = 1, bool disabled = false, int row = 0) { return WithSelectMenu(new SelectMenuBuilder() @@ -413,7 +412,7 @@ namespace Discord /// /// Gets or sets whether the current button is disabled. /// - public bool Disabled { get; set; } + public bool IsDisabled { get; set; } private string _label; @@ -432,14 +431,14 @@ namespace Discord /// The custom ID of this button. /// The custom ID of this button. /// The emote of this button. - /// Disabled this button or not. - public ButtonBuilder(string label = null, string customId = null, ButtonStyle style = ButtonStyle.Primary, string url = null, IEmote emote = null, bool disabled = false) + /// Disabled this button or not. + public ButtonBuilder(string label = null, string customId = null, ButtonStyle style = ButtonStyle.Primary, string url = null, IEmote emote = null, bool isDisabled = false) { CustomId = customId; Style = style; Url = url; Label = label; - Disabled = disabled; + IsDisabled = isDisabled; Emote = emote; } @@ -452,7 +451,7 @@ namespace Discord Style = button.Style; Url = button.Url; Label = button.Label; - Disabled = button.Disabled; + IsDisabled = button.IsDisabled; Emote = button.Emote; } @@ -566,11 +565,11 @@ namespace Discord /// /// Sets whether the current button is disabled. /// - /// Whether the current button is disabled or not. + /// Whether the current button is disabled or not. /// The current builder. - public ButtonBuilder WithDisabled(bool disabled) + public ButtonBuilder WithDisabled(bool isDisabled) { - Disabled = disabled; + IsDisabled = isDisabled; return this; } @@ -601,7 +600,7 @@ namespace Discord else if (string.IsNullOrEmpty(CustomId)) throw new InvalidOperationException("Non-link buttons must have a custom id associated with them"); - return new ButtonComponent(Style, Label, Emote, CustomId, Url, Disabled); + return new ButtonComponent(Style, Label, Emote, CustomId, Url, IsDisabled); } } @@ -718,7 +717,7 @@ namespace Discord /// /// Gets or sets whether the current menu is disabled. /// - public bool Disabled { get; set; } + public bool IsDisabled { get; set; } private List _options = new List(); private int _minValues = 1; @@ -740,7 +739,7 @@ namespace Discord CustomId = selectMenu.Placeholder; MaxValues = selectMenu.MaxValues; MinValues = selectMenu.MinValues; - Disabled = selectMenu.Disabled; + IsDisabled = selectMenu.IsDisabled; Options = selectMenu.Options? .Select(x => new SelectMenuOptionBuilder(x.Label, x.Value, x.Description, x.Emote, x.Default)) .ToList(); @@ -754,13 +753,13 @@ namespace Discord /// The placeholder of this select menu. /// The max values of this select menu. /// The min values of this select menu. - /// Disabled this select menu or not. - public SelectMenuBuilder(string customId, List options, string placeholder = null, int maxValues = 1, int minValues = 1, bool disabled = false) + /// Disabled this select menu or not. + public SelectMenuBuilder(string customId, List options, string placeholder = null, int maxValues = 1, int minValues = 1, bool isDisabled = false) { CustomId = customId; Options = options; Placeholder = placeholder; - Disabled = disabled; + IsDisabled = isDisabled; MaxValues = maxValues; MinValues = minValues; } @@ -859,27 +858,27 @@ namespace Discord /// The value of this option. /// The description of this option. /// The emote of this option. - /// Render this option as selected by default or not. + /// Render this option as selected by default or not. /// Options count reached . /// /// The current builder. /// - public SelectMenuBuilder AddOption(string label, string value, string description = null, IEmote emote = null, bool? @default = null) + public SelectMenuBuilder AddOption(string label, string value, string description = null, IEmote emote = null, bool? isDefault = null) { - AddOption(new SelectMenuOptionBuilder(label, value, description, emote, @default)); + AddOption(new SelectMenuOptionBuilder(label, value, description, emote, isDefault)); return this; } /// /// Sets whether the current menu is disabled. /// - /// Whether the current menu is disabled or not. + /// Whether the current menu is disabled or not. /// /// The current builder. /// - public SelectMenuBuilder WithDisabled(bool disabled) + public SelectMenuBuilder WithDisabled(bool isDisabled) { - Disabled = disabled; + IsDisabled = isDisabled; return this; } @@ -891,7 +890,7 @@ namespace Discord { var options = Options?.Select(x => x.Build()).ToList(); - return new SelectMenuComponent(CustomId, options, Placeholder, MinValues, MaxValues, Disabled); + return new SelectMenuComponent(CustomId, options, Placeholder, MinValues, MaxValues, IsDisabled); } } @@ -991,7 +990,7 @@ namespace Discord /// /// Gets or sets the whether or not this option will render selected by default. /// - public bool? Default { get; set; } + public bool? IsDefault { get; set; } private string _label; private string _value; @@ -1009,14 +1008,14 @@ namespace Discord /// The value of this option. /// The description of this option. /// The emote of this option. - /// Render this option as selected by default or not. - public SelectMenuOptionBuilder(string label, string value, string description = null, IEmote emote = null, bool? @default = null) + /// Render this option as selected by default or not. + public SelectMenuOptionBuilder(string label, string value, string description = null, IEmote emote = null, bool? isDefault = null) { Label = label; Value = value; Description = description; Emote = emote; - Default = @default; + this.IsDefault = isDefault; } /// @@ -1028,7 +1027,7 @@ namespace Discord Value = option.Value; Description = option.Description; Emote = option.Emote; - Default = option.Default; + IsDefault = option.Default; } /// @@ -1089,13 +1088,13 @@ namespace Discord /// /// Sets the field default. /// - /// The value to set the field default to. + /// The value to set the field default to. /// /// The current builder. /// - public SelectMenuOptionBuilder WithDefault(bool defaultValue) + public SelectMenuOptionBuilder WithDefault(bool isDefault) { - Default = defaultValue; + IsDefault = isDefault; return this; } @@ -1105,7 +1104,7 @@ namespace Discord /// The newly built . public SelectMenuOption Build() { - return new SelectMenuOption(Label, Value, Description, Emote, Default); + return new SelectMenuOption(Label, Value, Description, Emote, IsDefault); } } } diff --git a/src/Discord.Net.Core/Entities/Interactions/Message Components/MessageComponent.cs b/src/Discord.Net.Core/Entities/Interactions/Message Components/MessageComponent.cs index c1c8b2817..eb37a57b8 100644 --- a/src/Discord.Net.Core/Entities/Interactions/Message Components/MessageComponent.cs +++ b/src/Discord.Net.Core/Entities/Interactions/Message Components/MessageComponent.cs @@ -12,7 +12,7 @@ namespace Discord public class MessageComponent { /// - /// The components to be used in a message. + /// Gets the components to be used in a message. /// public IReadOnlyCollection Components { get; } diff --git a/src/Discord.Net.Core/Entities/Interactions/Message Components/SelectMenuComponent.cs b/src/Discord.Net.Core/Entities/Interactions/Message Components/SelectMenuComponent.cs index 4fa3e4393..a0b980c53 100644 --- a/src/Discord.Net.Core/Entities/Interactions/Message Components/SelectMenuComponent.cs +++ b/src/Discord.Net.Core/Entities/Interactions/Message Components/SelectMenuComponent.cs @@ -14,35 +14,33 @@ namespace Discord /// public ComponentType Type => ComponentType.SelectMenu; - /// - /// The custom id of this Select menu that will be sent with a . - /// + /// public string CustomId { get; } /// - /// The menus options to select from. + /// Gets the menus options to select from. /// public IReadOnlyCollection Options { get; } /// - /// A custom placeholder text if nothing is selected, max 100 characters. + /// Gets the custom placeholder text if nothing is selected. /// public string Placeholder { get; } /// - /// The minimum number of items that must be chosen; default 1, min 0, max 25 + /// Gets the minimum number of items that must be chosen. /// public int MinValues { get; } /// - /// The maximum number of items that can be chosen; default 1, max 25 + /// Gets the maximum number of items that can be chosen. /// public int MaxValues { get; } /// - /// Whether this menu is disabled or not. + /// Gets whether this menu is disabled or not. /// - public bool Disabled { get; } + public bool IsDisabled { get; } /// /// Turns this select menu into a builder. @@ -57,7 +55,7 @@ namespace Discord Placeholder, MaxValues, MinValues, - Disabled); + IsDisabled); internal SelectMenuComponent(string customId, List options, string placeholder, int minValues, int maxValues, bool disabled) { @@ -66,7 +64,7 @@ namespace Discord Placeholder = placeholder; MinValues = minValues; MaxValues = maxValues; - Disabled = disabled; + IsDisabled = disabled; } } } 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) { diff --git a/src/Discord.Net.Rest/API/Common/SelectMenuComponent.cs b/src/Discord.Net.Rest/API/Common/SelectMenuComponent.cs index 5476565dc..16daa66ab 100644 --- a/src/Discord.Net.Rest/API/Common/SelectMenuComponent.cs +++ b/src/Discord.Net.Rest/API/Common/SelectMenuComponent.cs @@ -40,7 +40,7 @@ namespace Discord.API Placeholder = component.Placeholder; MinValues = component.MinValues; MaxValues = component.MaxValues; - Disabled = component.Disabled; + Disabled = component.IsDisabled; } } } diff --git a/src/Discord.Net.Rest/Discord.Net.Rest.xml b/src/Discord.Net.Rest/Discord.Net.Rest.xml index 0c47d29d2..cd5187220 100644 --- a/src/Discord.Net.Rest/Discord.Net.Rest.xml +++ b/src/Discord.Net.Rest/Discord.Net.Rest.xml @@ -2435,10 +2435,10 @@ - + - + @@ -2730,10 +2730,10 @@ Represents a thread channel received over REST. - + - + @@ -2742,7 +2742,7 @@ - + diff --git a/src/Discord.Net.Rest/Entities/Channels/RestStageChannel.cs b/src/Discord.Net.Rest/Entities/Channels/RestStageChannel.cs index 41877befc..721e2d780 100644 --- a/src/Discord.Net.Rest/Entities/Channels/RestStageChannel.cs +++ b/src/Discord.Net.Rest/Entities/Channels/RestStageChannel.cs @@ -20,10 +20,10 @@ namespace Discord.Rest public StagePrivacyLevel? PrivacyLevel { get; private set; } /// - public bool? DiscoverableDisabled { get; private set; } + public bool? IsDiscoverableDisabled { get; private set; } /// - public bool Live { get; private set; } + public bool IsLive { get; private set; } internal RestStageChannel(BaseDiscordClient discord, IGuild guild, ulong id) : base(discord, guild, id) { @@ -39,18 +39,18 @@ namespace Discord.Rest internal void Update(StageInstance model, bool isLive = false) { - Live = isLive; + IsLive = isLive; if(isLive) { Topic = model.Topic; PrivacyLevel = model.PrivacyLevel; - DiscoverableDisabled = model.DiscoverableDisabled; + IsDiscoverableDisabled = model.DiscoverableDisabled; } else { Topic = null; PrivacyLevel = null; - DiscoverableDisabled = null; + IsDiscoverableDisabled = null; } } diff --git a/src/Discord.Net.Rest/Entities/Channels/RestThreadChannel.cs b/src/Discord.Net.Rest/Entities/Channels/RestThreadChannel.cs index 799d150b5..05117be06 100644 --- a/src/Discord.Net.Rest/Entities/Channels/RestThreadChannel.cs +++ b/src/Discord.Net.Rest/Entities/Channels/RestThreadChannel.cs @@ -16,10 +16,10 @@ namespace Discord.Rest { public ThreadType Type { get; private set; } /// - public bool Joined { get; private set; } + public bool HasJoined { get; private set; } /// - public bool Archived { get; private set; } + public bool IsArchived { get; private set; } /// public ThreadArchiveDuration AutoArchiveDuration { get; private set; } @@ -28,7 +28,7 @@ namespace Discord.Rest public DateTimeOffset ArchiveTimestamp { get; private set; } /// - public bool Locked { get; private set; } + public bool IsLocked { get; private set; } /// public int MemberCount { get; private set; } @@ -58,14 +58,14 @@ namespace Discord.Rest { base.Update(model); - Joined = model.ThreadMember.IsSpecified; + HasJoined = model.ThreadMember.IsSpecified; if (model.ThreadMetadata.IsSpecified) { - Archived = model.ThreadMetadata.Value.Archived; + IsArchived = model.ThreadMetadata.Value.Archived; AutoArchiveDuration = model.ThreadMetadata.Value.AutoArchiveDuration; ArchiveTimestamp = model.ThreadMetadata.Value.ArchiveTimestamp; - Locked = model.ThreadMetadata.Value.Locked.GetValueOrDefault(false); + IsLocked = model.ThreadMetadata.Value.Locked.GetValueOrDefault(false); } diff --git a/src/Discord.Net.WebSocket/Discord.Net.WebSocket.xml b/src/Discord.Net.WebSocket/Discord.Net.WebSocket.xml index a520d182a..c2f7382f1 100644 --- a/src/Discord.Net.WebSocket/Discord.Net.WebSocket.xml +++ b/src/Discord.Net.WebSocket/Discord.Net.WebSocket.xml @@ -2274,10 +2274,10 @@ - + - + @@ -2610,7 +2610,7 @@ Gets the current users within this thread. - + @@ -2629,7 +2629,7 @@ - + @@ -2638,7 +2638,7 @@ - + diff --git a/src/Discord.Net.WebSocket/Entities/Channels/SocketStageChannel.cs b/src/Discord.Net.WebSocket/Entities/Channels/SocketStageChannel.cs index ce529ca89..a8c0101e7 100644 --- a/src/Discord.Net.WebSocket/Entities/Channels/SocketStageChannel.cs +++ b/src/Discord.Net.WebSocket/Entities/Channels/SocketStageChannel.cs @@ -22,10 +22,10 @@ namespace Discord.WebSocket public StagePrivacyLevel? PrivacyLevel { get; private set; } /// - public bool? DiscoverableDisabled { get; private set; } + public bool? IsDiscoverableDisabled { get; private set; } /// - public bool Live { get; private set; } = false; + public bool IsLive { get; private set; } = false; /// /// Returns if the current user is a speaker within the stage, otherwise . @@ -62,18 +62,18 @@ namespace Discord.WebSocket internal void Update(StageInstance model, bool isLive = false) { - Live = isLive; + IsLive = isLive; if (isLive) { Topic = model.Topic; PrivacyLevel = model.PrivacyLevel; - DiscoverableDisabled = model.DiscoverableDisabled; + IsDiscoverableDisabled = model.DiscoverableDisabled; } else { Topic = null; PrivacyLevel = null; - DiscoverableDisabled = null; + IsDiscoverableDisabled = null; } } diff --git a/src/Discord.Net.WebSocket/Entities/Channels/SocketThreadChannel.cs b/src/Discord.Net.WebSocket/Entities/Channels/SocketThreadChannel.cs index 9a8f4b139..3fd47ec87 100644 --- a/src/Discord.Net.WebSocket/Entities/Channels/SocketThreadChannel.cs +++ b/src/Discord.Net.WebSocket/Entities/Channels/SocketThreadChannel.cs @@ -35,7 +35,7 @@ namespace Discord.WebSocket => Users.FirstOrDefault(x => x.Id == Discord.CurrentUser.Id); /// - public bool Joined { get; private set; } + public bool HasJoined { get; private set; } /// /// if this thread is private, otherwise @@ -55,7 +55,7 @@ namespace Discord.WebSocket public int MemberCount { get; private set; } /// - public bool Archived { get; private set; } + public bool IsArchived { get; private set; } /// public DateTimeOffset ArchiveTimestamp { get; private set; } @@ -64,7 +64,7 @@ namespace Discord.WebSocket public ThreadArchiveDuration AutoArchiveDuration { get; private set; } /// - public bool Locked { get; private set; } + public bool IsLocked { get; private set; } /// /// Gets a collection of cached users within this thread. @@ -106,10 +106,10 @@ namespace Discord.WebSocket if (model.ThreadMetadata.IsSpecified) { - Archived = model.ThreadMetadata.Value.Archived; + IsArchived = model.ThreadMetadata.Value.Archived; ArchiveTimestamp = model.ThreadMetadata.Value.ArchiveTimestamp; AutoArchiveDuration = (ThreadArchiveDuration)model.ThreadMetadata.Value.AutoArchiveDuration; - Locked = model.ThreadMetadata.Value.Locked.GetValueOrDefault(false); + IsLocked = model.ThreadMetadata.Value.Locked.GetValueOrDefault(false); } if (model.OwnerId.IsSpecified) @@ -117,7 +117,7 @@ namespace Discord.WebSocket Owner = GetUser(model.OwnerId.Value); } - Joined = model.ThreadMember.IsSpecified; + HasJoined = model.ThreadMember.IsSpecified; } internal IReadOnlyCollection RemoveUsers(ulong[] users)