Change the minimum allowed message to 13d23h59m

Connection/API lag could cause messages right on the edge of 14 weeks to fail on Discord's end when they pass our checks.
This commit is contained in:
Christopher F
2017-02-25 16:31:46 -05:00
parent 607f478b9a
commit 4a18b321ea

View File

@@ -185,7 +185,7 @@ namespace Discord
// Bulk Delete
public static void NoMessageOlderThanTwoWeeks(ulong[] collection, string name)
{
var minimum = DateTimeUtils.ToSnowflake(DateTimeOffset.Now.Subtract(TimeSpan.FromDays(14)));
var minimum = DateTimeUtils.ToSnowflake(DateTimeOffset.Now.Subtract(TimeSpan.FromMilliseconds(1209540000)));
for (var i = 0; i < collection.Length; i++)
if (collection[i] <= minimum) throw new ArgumentOutOfRangeException(name, "Messages must be younger than two weeks to delete.");
}