Ignore messages with an ID of 0 when calculating age
This commit is contained in:
@@ -188,6 +188,7 @@ namespace Discord
|
|||||||
var minimum = SnowflakeUtils.ToSnowflake(DateTimeOffset.UtcNow.Subtract(TimeSpan.FromDays(14)));
|
var minimum = SnowflakeUtils.ToSnowflake(DateTimeOffset.UtcNow.Subtract(TimeSpan.FromDays(14)));
|
||||||
for (var i = 0; i < collection.Length; i++)
|
for (var i = 0; i < collection.Length; i++)
|
||||||
{
|
{
|
||||||
|
if (collection[i] == 0) continue;
|
||||||
if (collection[i] <= minimum)
|
if (collection[i] <= minimum)
|
||||||
throw new ArgumentOutOfRangeException(name, "Messages must be younger than two weeks old.");
|
throw new ArgumentOutOfRangeException(name, "Messages must be younger than two weeks old.");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user