Skip to content

Commit

Permalink
fix(Role): pass Permissions class, not the bitfield (#5321)
Browse files Browse the repository at this point in the history
  • Loading branch information
vaporoxx committed Feb 22, 2021
1 parent ee5bc1a commit d744e51
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/structures/Role.js
Expand Up @@ -197,8 +197,6 @@ class Role extends Base {
* .catch(console.error);
*/
async edit(data, reason) {
if (typeof data.permissions !== 'undefined') data.permissions = Permissions.resolve(data.permissions);
else data.permissions = this.permissions.bitfield;
if (typeof data.position !== 'undefined') {
await Util.setPosition(
this,
Expand All @@ -220,7 +218,7 @@ class Role extends Base {
name: data.name || this.name,
color: data.color !== null ? Util.resolveColor(data.color || this.color) : null,
hoist: typeof data.hoist !== 'undefined' ? data.hoist : this.hoist,
permissions: data.permissions,
permissions: typeof data.permissions !== 'undefined' ? new Permissions(data.permissions) : this.permissions,
mentionable: typeof data.mentionable !== 'undefined' ? data.mentionable : this.mentionable,
},
reason,
Expand Down

0 comments on commit d744e51

Please sign in to comment.