From e364b3ae7c304c209ea8d526e494156a7bdcffd4 Mon Sep 17 00:00:00 2001 From: Casmir <68127614+csmir@users.noreply.github.com> Date: Thu, 9 Feb 2023 17:03:51 +0100 Subject: [PATCH] Apply suggestions from code review --- .../Guilds/AutoModeration/AutoModEventType.cs | 2 +- .../Entities/Guilds/AutoModeration/AutoModRule.cs | 12 ++++++------ .../Guilds/AutoModeration/AutoModRuleAction.cs | 4 ++-- .../Guilds/AutoModeration/AutoModRuleProperties.cs | 6 +++--- .../Entities/Guilds/AutoModeration/IAutoModRule.cs | 10 +++++----- src/Discord.Net.Core/Entities/Guilds/IGuild.cs | 2 +- src/Discord.Net.Rest/DiscordRestApiClient.cs | 6 +++--- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/Discord.Net.Core/Entities/Guilds/AutoModeration/AutoModEventType.cs b/src/Discord.Net.Core/Entities/Guilds/AutoModeration/AutoModEventType.cs index 3585dece1..6ed93d53b 100644 --- a/src/Discord.Net.Core/Entities/Guilds/AutoModeration/AutoModEventType.cs +++ b/src/Discord.Net.Core/Entities/Guilds/AutoModeration/AutoModEventType.cs @@ -12,7 +12,7 @@ namespace Discord public enum AutoModEventType { /// - /// When a member sends or edits a message in the guild + /// When a member sends or edits a message in the guild. /// MessageSend = 1 } diff --git a/src/Discord.Net.Core/Entities/Guilds/AutoModeration/AutoModRule.cs b/src/Discord.Net.Core/Entities/Guilds/AutoModeration/AutoModRule.cs index d65a70caa..31a7e0088 100644 --- a/src/Discord.Net.Core/Entities/Guilds/AutoModeration/AutoModRule.cs +++ b/src/Discord.Net.Core/Entities/Guilds/AutoModeration/AutoModRule.cs @@ -32,22 +32,22 @@ namespace Discord public string[] KeywordFilter { get; } /// - /// Gets regex patterns for the rule. + /// Gets regex patterns for the rule. Empty if the rule has no regexes. /// public string[] RegexPatterns { get; } /// - /// Gets the allow list for the rule. + /// Gets the allow list for the rule. Empty if the rule has no allowed terms. /// public string[] AllowList { get; } /// - /// Gets total mention limit for the rule. + /// Gets total mention limit for the rule. if not provided. /// public int? MentionLimit { get; } /// - /// Gets the presets for the rule. + /// Gets the presets for the rule. Empty if the rule has no presets. /// public KeywordPresetTypes[] Presets { get; } @@ -62,12 +62,12 @@ namespace Discord public bool Enabled { get; } /// - /// Gets the exempt roles for the rule. + /// Gets the exempt roles for the rule. Empty if the rule has no exempt roles. /// public ulong[] ExemptRoles { get; } /// - /// Gets the exempt channels for the rule. + /// Gets the exempt channels for the rule. Empty if the rule has no exempt channels. /// public ulong[] ExemptChannels { get; } diff --git a/src/Discord.Net.Core/Entities/Guilds/AutoModeration/AutoModRuleAction.cs b/src/Discord.Net.Core/Entities/Guilds/AutoModeration/AutoModRuleAction.cs index 7d7f3622a..531d435a6 100644 --- a/src/Discord.Net.Core/Entities/Guilds/AutoModeration/AutoModRuleAction.cs +++ b/src/Discord.Net.Core/Entities/Guilds/AutoModeration/AutoModRuleAction.cs @@ -17,12 +17,12 @@ namespace Discord public AutoModActionType Type { get; } /// - /// Get the channel id on which to post alerts. + /// Get the channel id on which to post alerts. if no channel has been provided. /// public ulong? ChannelId { get; } /// - /// Gets the duration of which a user will be timed out for breaking this rule. + /// Gets the duration of which a user will be timed out for breaking this rule. if no timeout duration has been provided. /// public TimeSpan? TimeoutDuration { get; } diff --git a/src/Discord.Net.Core/Entities/Guilds/AutoModeration/AutoModRuleProperties.cs b/src/Discord.Net.Core/Entities/Guilds/AutoModeration/AutoModRuleProperties.cs index 0e45b6625..217486c7a 100644 --- a/src/Discord.Net.Core/Entities/Guilds/AutoModeration/AutoModRuleProperties.cs +++ b/src/Discord.Net.Core/Entities/Guilds/AutoModeration/AutoModRuleProperties.cs @@ -47,7 +47,7 @@ namespace Discord public Optional MentionLimit { get; set; } /// - /// Gets or sets the presets for the rule. + /// Gets or sets the presets for the rule. Empty if the rule has no presets. /// public Optional Presets { get; set; } @@ -62,12 +62,12 @@ namespace Discord public Optional Enabled { get; set; } /// - /// Gets or sets the exempt roles for the rule. + /// Gets or sets the exempt roles for the rule. Empty if the rule has no exempt roles. /// public Optional ExemptRoles { get; set; } /// - /// Gets or sets the exempt channels for the rule. + /// Gets or sets the exempt channels for the rule. Empty if the rule has no exempt channels. /// public Optional ExemptChannels { get; set; } } diff --git a/src/Discord.Net.Core/Entities/Guilds/AutoModeration/IAutoModRule.cs b/src/Discord.Net.Core/Entities/Guilds/AutoModeration/IAutoModRule.cs index 5e09496a9..c87ecf3dc 100644 --- a/src/Discord.Net.Core/Entities/Guilds/AutoModeration/IAutoModRule.cs +++ b/src/Discord.Net.Core/Entities/Guilds/AutoModeration/IAutoModRule.cs @@ -46,7 +46,7 @@ namespace Discord public IReadOnlyCollection KeywordFilter { get; } /// - /// Gets regex patterns for this rule. + /// Gets regex patterns for this rule. Empty if the rule has no regexes. /// /// /// This collection will be empty if is not @@ -55,7 +55,7 @@ namespace Discord public IReadOnlyCollection RegexPatterns { get; } /// - /// Gets the allow list patterns for this rule. + /// Gets the allow list patterns for this rule. Empty if the rule has no allowed terms. /// /// /// This collection will be empty if is not @@ -64,7 +64,7 @@ namespace Discord public IReadOnlyCollection AllowList { get; } /// - /// Gets the preset keyword types for this rule. + /// Gets the preset keyword types for this rule. Empty if the rule has no presets. /// /// /// This collection will be empty if is not @@ -92,12 +92,12 @@ namespace Discord bool Enabled { get; } /// - /// Gets a collection of role ids that are exempt from this rule. + /// Gets a collection of role ids that are exempt from this rule. Empty if the rule has no exempt roles. /// IReadOnlyCollection ExemptRoles { get; } /// - /// Gets a collection of channel ids that are exempt from this rule. + /// Gets a collection of channel ids that are exempt from this rule. Empty if the rule has no exempt channels. /// IReadOnlyCollection ExemptChannels { get; } diff --git a/src/Discord.Net.Core/Entities/Guilds/IGuild.cs b/src/Discord.Net.Core/Entities/Guilds/IGuild.cs index d8feb69dd..9f7c02bd5 100644 --- a/src/Discord.Net.Core/Entities/Guilds/IGuild.cs +++ b/src/Discord.Net.Core/Entities/Guilds/IGuild.cs @@ -1288,7 +1288,7 @@ namespace Discord /// Creates a new auto moderation rule. /// /// - /// A task that represents the asynchronous creation operation. The task result contains the created . + /// A task that represents the asynchronous creation operation. The task result contains the created . /// Task CreateAutoModRuleAsync(AutoModRule props, RequestOptions options = null); } diff --git a/src/Discord.Net.Rest/DiscordRestApiClient.cs b/src/Discord.Net.Rest/DiscordRestApiClient.cs index 13771af71..b7898b97b 100644 --- a/src/Discord.Net.Rest/DiscordRestApiClient.cs +++ b/src/Discord.Net.Rest/DiscordRestApiClient.cs @@ -2129,7 +2129,7 @@ namespace Discord.API options = RequestOptions.CreateOrClone(options); - return await SendJsonAsync("POST", () => $"guilds/{guildId}/auto-moderation/rules", args, new BucketIds(guildId), options: options); + return await SendJsonAsync("POST", () => $"guilds/{guildId}/auto-moderation/rules", args, new BucketIds(guildId: guildId), options: options); } public async Task ModifyGuildAutoModRuleAsync(ulong guildId, ulong ruleId, ModifyAutoModRuleParams args, RequestOptions options) @@ -2139,7 +2139,7 @@ namespace Discord.API options = RequestOptions.CreateOrClone(options); - return await SendJsonAsync("PATCH", () => $"guilds/{guildId}/auto-moderation/rules/{ruleId}", args, new BucketIds(guildId), options: options); + return await SendJsonAsync("PATCH", () => $"guilds/{guildId}/auto-moderation/rules/{ruleId}", args, new BucketIds(guildId: guildId), options: options); } public async Task DeleteGuildAutoModRuleAsync(ulong guildId, ulong ruleId, RequestOptions options) @@ -2149,7 +2149,7 @@ namespace Discord.API options = RequestOptions.CreateOrClone(options); - await SendAsync("DELETE", () => $"guilds/{guildId}/auto-moderation/rules/{ruleId}", new BucketIds(guildId), options: options); + await SendAsync("DELETE", () => $"guilds/{guildId}/auto-moderation/rules/{ruleId}", new BucketIds(guildId: guildId), options: options); } #endregion