From 200bed7329bbcfa571824e10be1316a2bafb5ade Mon Sep 17 00:00:00 2001 From: ThePheggHerself Date: Sun, 11 Jun 2023 20:07:44 +0100 Subject: [PATCH] Allow more than 1 action to be registered per automod rule (#2687) Fixes an issue where you cannot register more than 1 automod rule due to the limit and length of the rules being inverted (This also has the side effect of allowing you to attempt to register 0 actions, resulting in a 50035 invalid body error) --- src/Discord.Net.Rest/Entities/Guilds/GuildHelper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Discord.Net.Rest/Entities/Guilds/GuildHelper.cs b/src/Discord.Net.Rest/Entities/Guilds/GuildHelper.cs index f902df8c..2f68e650 100644 --- a/src/Discord.Net.Rest/Entities/Guilds/GuildHelper.cs +++ b/src/Discord.Net.Rest/Entities/Guilds/GuildHelper.cs @@ -1100,7 +1100,7 @@ namespace Discord.Rest if (!args.Name.IsSpecified || string.IsNullOrWhiteSpace(args.Name.Value)) throw new ArgumentException("Name of the rule must not be empty", paramName: nameof(args.Name)); - Preconditions.AtLeast(1, args.Actions.GetValueOrDefault(Array.Empty()).Length, nameof(args.Actions), "Auto moderation rule must have at least 1 action"); + Preconditions.AtLeast(args.Actions.GetValueOrDefault(Array.Empty()).Length, 1, nameof(args.Actions), "Auto moderation rule must have at least 1 action"); if (args.RegexPatterns.IsSpecified) {