diff --git a/lib/Client.js b/lib/Client.js index 7bab63305..ca84ac412 100644 --- a/lib/Client.js +++ b/lib/Client.js @@ -650,9 +650,12 @@ class Client extends EventEmitter { * @returns {Promise} */ createRole(guildID, options, reason) { + if(options.permissions !== undefined) { + options.permissions = options.permissions instanceof Permission ? String(options.permissions.allow) : String(options.permissions); + } return this.requestHandler.request("POST", Endpoints.GUILD_ROLES(guildID), true, { name: options.name, - permissions: options.permissions instanceof Permission ? String(options.permissions.allow) : String(options.permissions), + permissions: options.permissions, color: options.color, hoist: options.hoist, mentionable: options.mentionable, @@ -1284,7 +1287,9 @@ class Client extends EventEmitter { */ editRole(guildID, roleID, options, reason) { options.reason = reason; - options.permissions = options.permissions instanceof Permission ? String(options.permissions.allow) : String(options.permissions); + if(options.permissions !== undefined) { + options.permissions = options.permissions instanceof Permission ? String(options.permissions.allow) : String(options.permissions); + } return this.requestHandler.request("PATCH", Endpoints.GUILD_ROLE(guildID, roleID), true, options).then((role) => new Role(role, this.guilds.get(guildID))); }