mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 10:03:31 +01:00
fix: don't patch set data with undefined (#6694)
This commit is contained in:
@@ -22,24 +22,33 @@ class Team extends Base {
|
||||
*/
|
||||
this.id = data.id;
|
||||
|
||||
/**
|
||||
* The name of the Team
|
||||
* @type {string}
|
||||
*/
|
||||
this.name = data.name;
|
||||
if ('name' in data) {
|
||||
/**
|
||||
* The name of the Team
|
||||
* @type {string}
|
||||
*/
|
||||
this.name = data.name;
|
||||
}
|
||||
|
||||
/**
|
||||
* The Team's icon hash
|
||||
* @type {?string}
|
||||
*/
|
||||
this.icon = data.icon ?? null;
|
||||
|
||||
/**
|
||||
* The Team's owner id
|
||||
* @type {?Snowflake}
|
||||
*/
|
||||
this.ownerId = data.owner_user_id ?? null;
|
||||
if ('icon' in data) {
|
||||
/**
|
||||
* The Team's icon hash
|
||||
* @type {?string}
|
||||
*/
|
||||
this.icon = data.icon;
|
||||
} else {
|
||||
this.icon ??= null;
|
||||
}
|
||||
|
||||
if ('owner_user_id' in data) {
|
||||
/**
|
||||
* The Team's owner id
|
||||
* @type {?Snowflake}
|
||||
*/
|
||||
this.ownerId = data.owner_user_id;
|
||||
} else {
|
||||
this.ownerId ??= null;
|
||||
}
|
||||
/**
|
||||
* The Team's members
|
||||
* @type {Collection<Snowflake, TeamMember>}
|
||||
|
||||
Reference in New Issue
Block a user