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)
This commit is contained in:
@@ -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<AutoModRuleActionProperties>()).Length, nameof(args.Actions), "Auto moderation rule must have at least 1 action");
|
||||
Preconditions.AtLeast(args.Actions.GetValueOrDefault(Array.Empty<AutoModRuleActionProperties>()).Length, 1, nameof(args.Actions), "Auto moderation rule must have at least 1 action");
|
||||
|
||||
if (args.RegexPatterns.IsSpecified)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user