refactor(GuildPreviewEmoji): make roles an array (#5720)

This commit is contained in:
Jan
2021-06-13 20:30:20 +02:00
committed by GitHub
parent 02693bc02f
commit 4dbcaf76c3
4 changed files with 24 additions and 22 deletions

View File

@@ -23,6 +23,14 @@ class GuildEmoji extends BaseGuildEmoji {
* @type {?User}
*/
this.author = null;
/**
* Array of role ids this emoji is active for
* @name GuildEmoji#_roles
* @type {Snowflake[]}
* @private
*/
Object.defineProperty(this, '_roles', { value: [], writable: true });
}
/**
@@ -39,7 +47,9 @@ class GuildEmoji extends BaseGuildEmoji {
_patch(data) {
super._patch(data);
if (typeof data.user !== 'undefined') this.author = this.client.users.add(data.user);
if (data.user) this.author = this.client.users.add(data.user);
if (data.roles) this._roles = data.roles;
}
/**