mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 11:03:30 +01:00
fix(Role): pass Permissions class, not the bitfield (#5321)
This commit is contained in:
@@ -197,8 +197,6 @@ class Role extends Base {
|
|||||||
* .catch(console.error);
|
* .catch(console.error);
|
||||||
*/
|
*/
|
||||||
async edit(data, reason) {
|
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') {
|
if (typeof data.position !== 'undefined') {
|
||||||
await Util.setPosition(
|
await Util.setPosition(
|
||||||
this,
|
this,
|
||||||
@@ -220,7 +218,7 @@ class Role extends Base {
|
|||||||
name: data.name || this.name,
|
name: data.name || this.name,
|
||||||
color: data.color !== null ? Util.resolveColor(data.color || this.color) : null,
|
color: data.color !== null ? Util.resolveColor(data.color || this.color) : null,
|
||||||
hoist: typeof data.hoist !== 'undefined' ? data.hoist : this.hoist,
|
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,
|
mentionable: typeof data.mentionable !== 'undefined' ? data.mentionable : this.mentionable,
|
||||||
},
|
},
|
||||||
reason,
|
reason,
|
||||||
|
|||||||
Reference in New Issue
Block a user