Browse Source

Ignore messages with an ID of 0 when calculating age

tags/2.0.0-beta
Christopher F 7 years ago
parent
commit
676be4081b
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      src/Discord.Net.Core/Utils/Preconditions.cs

+ 2
- 1
src/Discord.Net.Core/Utils/Preconditions.cs View File

@@ -188,7 +188,8 @@ namespace Discord
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.");
}
}


Loading…
Cancel
Save