fix(GuildMember): joinedAt possibly being NaN (#11224)

This commit is contained in:
TÆMBØØ
2025-10-30 13:59:02 -07:00
committed by GitHub
parent 94a9b4d03c
commit 178c9cb348

View File

@@ -24,13 +24,6 @@ class GuildMember extends Base {
*/
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
*
@@ -104,7 +97,17 @@ class GuildMember extends Base {
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) {
this.premiumSinceTimestamp = data.premium_since ? Date.parse(data.premium_since) : null;
}