From ff49b82db773f0407ac0e890897156fb52843b11 Mon Sep 17 00:00:00 2001 From: Jiralite <33201955+Jiralite@users.noreply.github.com> Date: Thu, 14 Apr 2022 11:45:35 +0100 Subject: [PATCH] feat: backport (#7778) --- src/structures/Invite.js | 7 +++++-- src/structures/VoiceState.js | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/structures/Invite.js b/src/structures/Invite.js index 0ed8b45e24b7..ee84b8b58bee 100644 --- a/src/structures/Invite.js +++ b/src/structures/Invite.js @@ -197,8 +197,11 @@ class Invite extends Base { this.createdTimestamp ??= null; } - if ('expires_at' in data) this._expiresTimestamp = new Date(data.expires_at).getTime(); - else this._expiresTimestamp ??= null; + if ('expires_at' in data) { + this._expiresTimestamp = data.expires_at && Date.parse(data.expires_at); + } else { + this._expiresTimestamp ??= null; + } if ('stage_instance' in data) { /** diff --git a/src/structures/VoiceState.js b/src/structures/VoiceState.js index 78d9bf551c52..da1c2d07a260 100644 --- a/src/structures/VoiceState.js +++ b/src/structures/VoiceState.js @@ -118,7 +118,7 @@ class VoiceState extends Base { * The time at which the member requested to speak. This property is specific to stage channels only. * @type {?number} */ - this.requestToSpeakTimestamp = new Date(data.request_to_speak_timestamp).getTime(); + this.requestToSpeakTimestamp = data.request_to_speak_timestamp && Date.parse(data.request_to_speak_timestamp); } else { this.requestToSpeakTimestamp ??= null; }