mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix(GuildMember): joinedAt possibly being NaN
Co-Authored-By: TÆMBØØ <69138346+TAEMBO@users.noreply.github.com>
This commit is contained in:
@@ -24,12 +24,6 @@ class GuildMember extends Base {
|
|||||||
*/
|
*/
|
||||||
this.guild = guild;
|
this.guild = guild;
|
||||||
|
|
||||||
/**
|
|
||||||
* The timestamp the member joined the guild at
|
|
||||||
* @type {?number}
|
|
||||||
*/
|
|
||||||
this.joinedTimestamp = null;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The last timestamp this member started boosting the guild
|
* The last timestamp this member started boosting the guild
|
||||||
* @type {?number}
|
* @type {?number}
|
||||||
@@ -95,7 +89,17 @@ class GuildMember extends Base {
|
|||||||
this.banner ??= null;
|
this.banner ??= null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ('joined_at' in data) this.joinedTimestamp = Date.parse(data.joined_at);
|
if ('joined_at' in data) {
|
||||||
|
/**
|
||||||
|
* The timestamp the member joined the guild at
|
||||||
|
*
|
||||||
|
* @type {?number}
|
||||||
|
*/
|
||||||
|
this.joinedTimestamp = data.joined_at && Date.parse(data.joined_at);
|
||||||
|
} else {
|
||||||
|
this.joinedTimestamp ??= null;
|
||||||
|
}
|
||||||
|
|
||||||
if ('premium_since' in data) {
|
if ('premium_since' in data) {
|
||||||
this.premiumSinceTimestamp = data.premium_since ? Date.parse(data.premium_since) : null;
|
this.premiumSinceTimestamp = data.premium_since ? Date.parse(data.premium_since) : null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user