Skip to content

Commit 200bed7

Browse files
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)
1 parent 277c7af commit 200bed7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Discord.Net.Rest/Entities/Guilds/GuildHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1100,7 +1100,7 @@ public static async Task<AutoModerationRule> CreateAutoModRuleAsync(IGuild guild
11001100
if (!args.Name.IsSpecified || string.IsNullOrWhiteSpace(args.Name.Value))
11011101
throw new ArgumentException("Name of the rule must not be empty", paramName: nameof(args.Name));
11021102

1103-
Preconditions.AtLeast(1, args.Actions.GetValueOrDefault(Array.Empty<AutoModRuleActionProperties>()).Length, nameof(args.Actions), "Auto moderation rule must have at least 1 action");
1103+
Preconditions.AtLeast(args.Actions.GetValueOrDefault(Array.Empty<AutoModRuleActionProperties>()).Length, 1, nameof(args.Actions), "Auto moderation rule must have at least 1 action");
11041104

11051105
if (args.RegexPatterns.IsSpecified)
11061106
{

0 commit comments

Comments
 (0)