A few datetime fixes

This commit is contained in:
RogueException
2017-03-22 05:22:11 -03:00
parent 22e6b0f386
commit 32cf7ba5e1
2 changed files with 6 additions and 3 deletions

View File

@@ -185,9 +185,12 @@ namespace Discord
// Bulk Delete
public static void YoungerThanTwoWeeks(ulong[] collection, string name)
{
var minimum = DateTimeUtils.ToSnowflake(DateTimeOffset.Now.Subtract(TimeSpan.FromMilliseconds(1209540000)));
var minimum = DateTimeUtils.ToSnowflake(DateTimeOffset.UtcNow.Subtract(TimeSpan.FromDays(14)));
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 old.");
}
}
}
}