From 8d7e745ee8283f41b6f7bceb87b46e151c36551c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89velyne=20Lachance?= Date: Thu, 19 Oct 2017 01:07:18 -0400 Subject: [PATCH] Patch timestamp of 0 on guild join date (#2041) The Discord API seems to send a timestamp of 0 for the joined_at on presence updates. This patch resolves this by ignoring timestamps of 0. --- src/structures/GuildMember.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/structures/GuildMember.js b/src/structures/GuildMember.js index ba03def2a..c4c2d6a81 100644 --- a/src/structures/GuildMember.js +++ b/src/structures/GuildMember.js @@ -64,7 +64,7 @@ class GuildMember extends Base { * @type {number} * @name GuildMember#joinedTimestamp */ - if (typeof data.joined_at !== 'undefined') this.joinedTimestamp = new Date(data.joined_at).getTime(); + if (data.joined_at) this.joinedTimestamp = new Date(data.joined_at).getTime(); this.user = this.guild.client.users.create(data.user); if (data.roles) this._roles = data.roles;