From 178c9cb3483c74b16f1d0702522a73d87e6e89fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=86MB=C3=98=C3=98?= <69138346+TAEMBO@users.noreply.github.com> Date: Thu, 30 Oct 2025 13:59:02 -0700 Subject: [PATCH] fix(GuildMember): joinedAt possibly being NaN (#11224) --- .../discord.js/src/structures/GuildMember.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/packages/discord.js/src/structures/GuildMember.js b/packages/discord.js/src/structures/GuildMember.js index be68184d5..a4ec04715 100644 --- a/packages/discord.js/src/structures/GuildMember.js +++ b/packages/discord.js/src/structures/GuildMember.js @@ -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; }