Check that messages older than two weeks are not passed to bulk delete

This resolves #477
This commit is contained in:
Christopher F
2017-02-23 17:39:10 -05:00
parent 9d7073fafe
commit 607f478b9a
3 changed files with 11 additions and 0 deletions

View File

@@ -12,6 +12,8 @@ namespace Discord
public static DateTimeOffset FromSnowflake(ulong value)
=> FromUnixMilliseconds((long)((value >> 22) + 1420070400000UL));
public static ulong ToSnowflake(DateTimeOffset value)
=> (ulong)(ToUnixMilliseconds(value) - 1420070400000L) << 22;
public static DateTimeOffset FromTicks(long ticks)
=> new DateTimeOffset(ticks, TimeSpan.Zero);