Skip to content

Commit

Permalink
fix(PermissionOverwriteManager): pass ID to API correctly (#6026)
Browse files Browse the repository at this point in the history
  • Loading branch information
monbrey committed Jul 3, 2021
1 parent 8c7cb0e commit 8077e4f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/managers/PermissionOverwriteManager.js
Expand Up @@ -136,10 +136,10 @@ class PermissionOverwriteManager extends CachedManager {
* @returns {GuildChannel}
*/
async delete(userOrRole, reason) {
userOrRole = this.channel.guild.roles.resolveID(userOrRole) ?? this.client.users.resolveID(userOrRole);
if (!userOrRole) throw new TypeError('INVALID_TYPE', 'parameter', 'User nor a Role');
const userOrRoleID = this.channel.guild.roles.resolveID(userOrRole) ?? this.client.users.resolveID(userOrRole);
if (!userOrRoleID) throw new TypeError('INVALID_TYPE', 'parameter', 'User nor a Role');

await this.client.api.channels(this.channel.id).permissions(userOrRole.id).delete({ reason });
await this.client.api.channels(this.channel.id).permissions(userOrRoleID).delete({ reason });
return this.channel;
}
}
Expand Down

0 comments on commit 8077e4f

Please sign in to comment.