From 75b0a7ce508f615c30d81f3306ac7adff4991fe5 Mon Sep 17 00:00:00 2001 From: Noikoio Date: Thu, 12 Dec 2019 23:07:35 -0800 Subject: [PATCH] Use snowflake timestamp for unknown cache messages --- RegexBot/Module/ModLogs/MessageCache.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/RegexBot/Module/ModLogs/MessageCache.cs b/RegexBot/Module/ModLogs/MessageCache.cs index da0b05e..3419d5c 100644 --- a/RegexBot/Module/ModLogs/MessageCache.cs +++ b/RegexBot/Module/ModLogs/MessageCache.cs @@ -121,7 +121,8 @@ namespace Noikoio.RegexBot.Module.ModLogs { msgAuthorId = 0; msgContent = "*(Message not in cache.)*"; - msgCreateTime = DateTimeOffset.UtcNow; + // Get timestamp from snowflake + msgCreateTime = DateTimeOffset.FromUnixTimeMilliseconds((long)(messageId >> 22) + 1420070400000); msgEditTime = null; } }