fix: don't patch missing properties from partial payloads (#5796)

* fix: don't patch missing properties from partial payloads

* fix(GuildChannel): initialize permissionOverwrites in the constructor

* refactor(GuildChannel): remove redundant if
This commit is contained in:
SpaceEEC
2021-06-10 18:42:45 +02:00
committed by GitHub
parent ffabec3a5e
commit 097c7b9cdd
5 changed files with 87 additions and 64 deletions

View File

@@ -30,6 +30,18 @@ class User extends Base {
this.system = null;
this.flags = null;
/**
* The ID of the last message sent by the user, if one was sent
* @type {?Snowflake}
*/
this.lastMessageID = null;
/**
* The ID of the channel for the last message sent by the user, if one was sent
* @type {?Snowflake}
*/
this.lastMessageChannelID = null;
this._patch(data);
}
@@ -87,18 +99,6 @@ class User extends Base {
*/
this.flags = new UserFlags(data.public_flags);
}
/**
* The ID of the last message sent by the user, if one was sent
* @type {?Snowflake}
*/
this.lastMessageID = null;
/**
* The ID of the channel for the last message sent by the user, if one was sent
* @type {?Snowflake}
*/
this.lastMessageChannelID = null;
}
/**