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:
@@ -185,7 +185,7 @@ namespace Discord
|
|||||||
// Bulk Delete
|
// Bulk Delete
|
||||||
public static void NoMessageOlderThanTwoWeeks(ulong[] collection, string name)
|
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++)
|
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.");
|
if (collection[i] <= minimum) throw new ArgumentOutOfRangeException(name, "Messages must be younger than two weeks to delete.");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user