Update DMChannel.js

This commit is contained in:
Elysia
2025-02-14 23:00:47 +07:00
parent 98191fe05d
commit 9ae420e0de

View File

@@ -49,7 +49,7 @@ class DMChannel extends Channel {
* The timestamp when the last pinned message was pinned, if there was one * The timestamp when the last pinned message was pinned, if there was one
* @type {?number} * @type {?number}
*/ */
this.lastPinTimestamp = new Date(data.last_pin_timestamp).getTime(); this.lastPinTimestamp = data.last_pin_timestamp ? Date.parse(data.last_pin_timestamp) : null;
} else { } else {
this.lastPinTimestamp ??= null; this.lastPinTimestamp ??= null;
} }
@@ -67,7 +67,9 @@ class DMChannel extends Channel {
* The timestamp when the message request was created * The timestamp when the message request was created
* @type {?number} * @type {?number}
*/ */
this.messageRequestTimestamp = new Date(data.is_message_request_timestamp).getTime(); this.messageRequestTimestamp = data.is_message_request_timestamp
? Date.parse(data.is_message_request_timestamp)
: null;
} }
} }