fix(GuildMember): joinedAt possibly being NaN

Co-Authored-By: TÆMBØØ <69138346+TAEMBO@users.noreply.github.com>
This commit is contained in:
Jiralite
2025-10-30 21:01:17 +00:00
parent c303bf3329
commit fb2b7281e0

View File

@@ -24,12 +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
* @type {?number}
@@ -95,7 +89,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;
}