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:
Christopher F
2017-04-15 18:03:19 -04:00
committed by RogueException
parent 8d9e11c08a
commit 660d4b0bf6
2 changed files with 4 additions and 1 deletions

View File

@@ -65,8 +65,10 @@ namespace Discord
/// <summary> Gets a collection of all users banned on this guild. </summary>
Task<IReadOnlyCollection<IBan>> GetBansAsync(RequestOptions options = null);
/// <summary> Bans the provided user from this guild and optionally prunes their recent messages. </summary>
/// <param name="pruneDays">The number of days to remove messages from this user for - must be between [0, 7]</param>
Task AddBanAsync(IUser user, int pruneDays = 0, RequestOptions options = null);
/// <summary> Bans the provided user id from this guild and optionally prunes their recent messages. </summary>
/// <param name="pruneDays">The number of days to remove messages from this user for - must be between [0, 7]</param>
Task AddBanAsync(ulong userId, int pruneDays = 0, RequestOptions options = null);
/// <summary> Unbans the provided user if it is currently banned. </summary>
Task RemoveBanAsync(IUser user, RequestOptions options = null);