mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
fix(PermissionOverwriteManager): pass ID to API correctly (#6026)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user