From 464fc14edda6c4202ba922807a25013b77d2d703 Mon Sep 17 00:00:00 2001 From: Pascal Date: Wed, 28 Feb 2018 09:31:42 +0100 Subject: [PATCH] fix(Activity): ensure that timestamps are actually numbers Fixes #2364 Discord sends those timestamps packed as SMALL_BIG_EXT, which get converted to strings in js. ~~Maybe they are already preparing their timestamps for 2038.~~ --- src/structures/Presence.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/structures/Presence.js b/src/structures/Presence.js index e4359539d..42c2abaa2 100644 --- a/src/structures/Presence.js +++ b/src/structures/Presence.js @@ -108,8 +108,8 @@ class Activity { * @prop {?Date} end When the activity will end */ this.timestamps = data.timestamps ? { - start: data.timestamps.start ? new Date(data.timestamps.start) : null, - end: data.timestamps.end ? new Date(data.timestamps.end) : null, + start: data.timestamps.start ? new Date(Number(data.timestamps.start)) : null, + end: data.timestamps.end ? new Date(Number(data.timestamps.end)) : null, } : null; /**