mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user