diff --git a/src/structure/components/commands/administration/Permissions.js b/src/structure/components/commands/administration/Permissions.js index b43f64d..26dec9b 100644 --- a/src/structure/components/commands/administration/Permissions.js +++ b/src/structure/components/commands/administration/Permissions.js @@ -237,15 +237,22 @@ class PermissionsCommand extends SlashCommand { const target = role?.value || member?.value; const targetPerms = permissions[target.id]; - fields.push({ - name: interaction.format('COMMAND_PERMISSIONS_GLOBAL_PERMS'), - value: `\`${targetPerms.global.join('`, `')}\`` - }); - const channels = channel ? [channel.value] : await guild.resolveChannels(Object.keys(targetPerms.channels)); - for (const ch of channels) { + if(targetPerms) { fields.push({ - name: `#${ch.name}`, - value: `\`${targetPerms.channels[ch.id].join('`, `')}\`` + name: interaction.format('COMMAND_PERMISSIONS_GLOBAL_PERMS'), + value: `\`${targetPerms.global.join('`, `')}\`` + }); + const channels = channel ? [channel.value] : await guild.resolveChannels(Object.keys(targetPerms.channels)); + for (const ch of channels) { + fields.push({ + name: `#${ch.name}`, + value: `\`${targetPerms.channels[ch.id].join('`, `')}\`` + }); + } + } else { + fields.push({ + name: target.name || target.user.tag, + value: guild.format('COMMAND_PERMISSIONS_NO_PERMS') }); } diff --git a/src/structure/components/settings/logging/Voice.js b/src/structure/components/settings/logging/Voice.js index 972a42c..ebbf632 100644 --- a/src/structure/components/settings/logging/Voice.js +++ b/src/structure/components/settings/logging/Voice.js @@ -33,7 +33,7 @@ class Voice extends Setting { if (opts.enabled) setting.enabled = opts.enabled.value; if (opts.channel) setting.channel = opts.channel.value.id; - + return { index: 'SETTING_SUCCESS_ALT' }; } @@ -48,7 +48,7 @@ class Voice extends Setting { }, { name: 'GENERAL_CHANNEL', - value: `<#${setting.channel}>`, + value: setting.channel ? `<#${setting.channel}>` : '**N/A**', inline: true } ]; diff --git a/src/utilities/SettingsMigrator.js b/src/utilities/SettingsMigrator.js index a2de1c6..8a400d5 100644 --- a/src/utilities/SettingsMigrator.js +++ b/src/utilities/SettingsMigrator.js @@ -68,7 +68,7 @@ class SettingsMigrator { // const { _version } = settings; // if (!_version) return Promise.reject(new Error('Unable to determine configuration version')); - const translated = this[version](settings); + const translated = this[version](settings.settings || settings); let webhook = null, permissions = null; @@ -207,7 +207,6 @@ class SettingsMigrator { } '2'(result) { - if (result.settings) result = result.settings; const { moderation, modlogs, muterole, mutetype, automod, wordFilter, ignore, invitefilter, chatlogs, activity, selfrole, killitwithfire, memberlogs, staffRole, staffRule, modpoints, userlogs, grantable, privatelog, linkfilter, autorole, welcomer, prefix, protection } = result;