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.
This commit is contained in:
Évelyne Lachance
2017-10-19 01:07:18 -04:00
committed by Crawl
parent 6b249ba454
commit 8d7e745ee8

View File

@@ -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;