fix(ThreadChannel): Make ownerId always present

#10618 djs
This commit is contained in:
Elysia
2025-01-21 00:58:18 +07:00
parent 6170b3755b
commit 963d244d07
2 changed files with 7 additions and 11 deletions

View File

@@ -24,6 +24,12 @@ class ThreadChannel extends Channel {
*/
this.guild = guild;
/**
* The id of the member who created this thread
* @type {Snowflake}
*/
this.ownerId = data.owner_id;
/**
* The id of the guild the channel is in
* @type {Snowflake}
@@ -117,16 +123,6 @@ class ThreadChannel extends Channel {
this._createdTimestamp ??= this.type === 'GUILD_PRIVATE_THREAD' ? super.createdTimestamp : null;
if ('owner_id' in data) {
/**
* The id of the member who created this thread
* @type {?Snowflake}
*/
this.ownerId = data.owner_id;
} else {
this.ownerId ??= null;
}
if ('last_message_id' in data) {
/**
* The last message id sent in this thread, if one was sent