Skip to content

Commit

Permalink
refactor(GuildMember): make _roles property non-enumerable (#9387)
Browse files Browse the repository at this point in the history
* refactor(GuildMember): make _roles a getter and roles a normal prop

* fix: revert changes

* fix: requested changes

* fix: requested changes

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
Idris1401 and kodiakhq[bot] authored May 18, 2023
1 parent cffa5d1 commit 46167a7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/discord.js/src/structures/GuildMember.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,12 @@ class GuildMember extends Base {

/**
* The role ids of the member
* @name GuildMember#_roles
* @type {Snowflake[]}
* @private
*/
this._roles = [];
Object.defineProperty(this, '_roles', { value: [], writable: true });

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

Expand Down

0 comments on commit 46167a7

Please sign in to comment.