Skip to content

Commit

Permalink
Ignore messages with an ID of 0 when calculating age
Browse files Browse the repository at this point in the history
  • Loading branch information
foxbot committed Nov 7, 2017
1 parent 14fbe40 commit 676be40
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Discord.Net.Core/Utils/Preconditions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ public static void YoungerThanTwoWeeks(ulong[] collection, string name)
var minimum = SnowflakeUtils.ToSnowflake(DateTimeOffset.UtcNow.Subtract(TimeSpan.FromDays(14)));
for (var i = 0; i < collection.Length; i++)
{
if (collection[i] <= minimum)
if (collection[i] == 0) continue;
if (collection[i] <= minimum)
throw new ArgumentOutOfRangeException(name, "Messages must be younger than two weeks old.");
}
}
Expand Down

0 comments on commit 676be40

Please sign in to comment.