Add an upper limit to prune length when banning a user (#611)
Messages may only be pruned between 0 and 7 days, otherwise a 400 will be thrown.
This commit is contained in:
committed by
RogueException
parent
8d9e11c08a
commit
660d4b0bf6
@@ -798,7 +798,8 @@ namespace Discord.API
|
||||
Preconditions.NotEqual(guildId, 0, nameof(guildId));
|
||||
Preconditions.NotEqual(userId, 0, nameof(userId));
|
||||
Preconditions.NotNull(args, nameof(args));
|
||||
Preconditions.AtLeast(args.DeleteMessageDays, 0, nameof(args.DeleteMessageDays));
|
||||
Preconditions.AtLeast(args.DeleteMessageDays, 0, nameof(args.DeleteMessageDays), "Prune length must be within [0, 7]");
|
||||
Preconditions.AtMost(args.DeleteMessageDays, 7, nameof(args.DeleteMessageDays), "Prune length must be within [0, 7]");
|
||||
options = RequestOptions.CreateOrClone(options);
|
||||
|
||||
var ids = new BucketIds(guildId: guildId);
|
||||
|
||||
Reference in New Issue
Block a user