mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix(PermissionOverwriteManager): mutates user (#8282)
Fix PermissionOverwriteManager changing userOrRole Since it's mutated the original Member object won't be passed to upset and will be seen as invalid if User cache is disabled. Functions normally even with User cache disabled after the fix.
This commit is contained in:
@@ -142,8 +142,9 @@ class PermissionOverwriteManager extends CachedManager {
|
||||
* .catch(console.error);
|
||||
*/
|
||||
edit(userOrRole, options, overwriteOptions) {
|
||||
userOrRole = this.channel.guild.roles.resolveId(userOrRole) ?? this.client.users.resolveId(userOrRole);
|
||||
const existing = this.cache.get(userOrRole);
|
||||
const existing = this.cache.get(
|
||||
this.channel.guild.roles.resolveId(userOrRole) ?? this.client.users.resolveId(userOrRole),
|
||||
);
|
||||
return this.upsert(userOrRole, options, overwriteOptions, existing);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user