From 79fbf9a181e58388ec2a729df27322f48e9910dc Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Tue, 19 Jul 2022 10:57:33 +0300 Subject: [PATCH] bugfix --- .../components/commands/administration/Permissions.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/structure/components/commands/administration/Permissions.js b/src/structure/components/commands/administration/Permissions.js index 26dec9b..37a0210 100644 --- a/src/structure/components/commands/administration/Permissions.js +++ b/src/structure/components/commands/administration/Permissions.js @@ -232,6 +232,7 @@ class PermissionsCommand extends SlashCommand { const permissions = await guild.permissions(); const fields = []; + let update = false; if (member || role) { @@ -322,6 +323,11 @@ class PermissionsCommand extends SlashCommand { } } + if (!value.length) { + delete permissions[targetId]; + update = true; + continue; + } fields.push({ name: target.tag || target.name, value @@ -330,6 +336,8 @@ class PermissionsCommand extends SlashCommand { } } + await guild.updatePermissions(); + if(!fields.length) return { index: 'COMMAND_PERMISSIONS_NO_PERMS' }; const embed = { title: interaction.format('COMMAND_PERMISSIONS_SHOW_TITLE'),