Skip to content

Commit

Permalink
fix(Role): check for presence of icon and unicode_emoji before patchi…
Browse files Browse the repository at this point in the history
…ng (#6780)
  • Loading branch information
iShibi committed Oct 7, 2021
1 parent d32956c commit e31c5ca
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/structures/Role.js
Expand Up @@ -20,6 +20,18 @@ class Role extends Base {
*/
this.guild = guild;

/**
* The icon hash of the role
* @type {?string}
*/
this.icon = null;

/**
* The unicode emoji for the role
* @type {?string}
*/
this.unicodeEmoji = null;

if (data) this._patch(data);
}

Expand Down Expand Up @@ -91,17 +103,9 @@ class Role extends Base {
*/
this.deleted = false;

/**
* The icon hash of the role
* @type {?string}
*/
this.icon = data.icon;
if ('icon' in data) this.icon = data.icon;

/**
* The unicode emoji for the role
* @type {?string}
*/
this.unicodeEmoji = data.unicode_emoji;
if ('unicode_emoji' in data) this.unicodeEmoji = data.unicode_emoji;

/**
* The tags this role has
Expand Down

0 comments on commit e31c5ca

Please sign in to comment.