From 110c8590a7dd56c9cb0872fd858224b79e9b0416 Mon Sep 17 00:00:00 2001 From: March 7th <71698422+aiko-chan-ai@users.noreply.github.com> Date: Mon, 18 Jul 2022 00:58:28 +0700 Subject: [PATCH] fix(PermissionOverwriteManager): mutates user #8282 v13.9.0 --- src/managers/PermissionOverwriteManager.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/managers/PermissionOverwriteManager.js b/src/managers/PermissionOverwriteManager.js index 066092b..5793073 100644 --- a/src/managers/PermissionOverwriteManager.js +++ b/src/managers/PermissionOverwriteManager.js @@ -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); }