mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 11:33: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}
|
* @returns {GuildChannel}
|
||||||
*/
|
*/
|
||||||
async delete(userOrRole, reason) {
|
async delete(userOrRole, reason) {
|
||||||
userOrRole = this.channel.guild.roles.resolveID(userOrRole) ?? this.client.users.resolveID(userOrRole);
|
const userOrRoleID = this.channel.guild.roles.resolveID(userOrRole) ?? this.client.users.resolveID(userOrRole);
|
||||||
if (!userOrRole) throw new TypeError('INVALID_TYPE', 'parameter', 'User nor a Role');
|
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;
|
return this.channel;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user