fix: don't patch set data with undefined (#6694)

This commit is contained in:
Rodry
2021-10-03 13:59:52 +01:00
committed by GitHub
parent 8b4456e0aa
commit 9eb9591473
33 changed files with 1211 additions and 795 deletions

View File

@@ -25,9 +25,9 @@ class BaseGuildEmoji extends Emoji {
}
_patch(data) {
if (data.name) this.name = data.name;
if ('name' in data) this.name = data.name;
if (typeof data.require_colons !== 'undefined') {
if ('require_colons' in data) {
/**
* Whether or not this emoji requires colons surrounding it
* @type {?boolean}
@@ -35,7 +35,7 @@ class BaseGuildEmoji extends Emoji {
this.requiresColons = data.require_colons;
}
if (typeof data.managed !== 'undefined') {
if ('managed' in data) {
/**
* Whether this emoji is managed by an external service
* @type {?boolean}
@@ -43,7 +43,7 @@ class BaseGuildEmoji extends Emoji {
this.managed = data.managed;
}
if (typeof data.available !== 'undefined') {
if ('available' in data) {
/**
* Whether this emoji is available
* @type {?boolean}