Update GroupDMChannel.js

This commit is contained in:
Elysia
2025-02-14 22:58:20 +07:00
parent 921b8c96c5
commit 98191fe05d

View File

@@ -36,12 +36,24 @@ class GroupDMChannel extends Channel {
this._recipients = []; this._recipients = [];
} }
if ('owner_id' in data) {
/**
* The user id of the owner of this Group DM Channel
* @type {?Snowflake}
*/
this.ownerId = data.owner_id;
} else {
this.ownerId ??= null;
}
if ('last_message_id' in data) { if ('last_message_id' in data) {
/** /**
* The channel's last message id, if one was sent * The channel's last message id, if one was sent
* @type {?Snowflake} * @type {?Snowflake}
*/ */
this.lastMessageId = data.last_message_id; this.lastMessageId = data.last_message_id;
} else {
this.lastMessageId ??= null;
} }
if ('last_pin_timestamp' in data) { if ('last_pin_timestamp' in data) {
@@ -49,19 +61,11 @@ class GroupDMChannel 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;
} }
if ('owner_id' in data) {
/**
* Owner ID
* @type {Snowflake}
*/
this.ownerId = data.owner_id;
}
if ('name' in data) { if ('name' in data) {
/** /**
* The name of this Group DM Channel * The name of this Group DM Channel