small fixes

This commit is contained in:
Erik 2022-07-07 21:12:35 +03:00
parent 68066db1bb
commit ea082e5f51
Signed by: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB
3 changed files with 18 additions and 12 deletions

View File

@ -237,15 +237,22 @@ class PermissionsCommand extends SlashCommand {
const target = role?.value || member?.value; const target = role?.value || member?.value;
const targetPerms = permissions[target.id]; const targetPerms = permissions[target.id];
fields.push({ if(targetPerms) {
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({ fields.push({
name: `#${ch.name}`, name: interaction.format('COMMAND_PERMISSIONS_GLOBAL_PERMS'),
value: `\`${targetPerms.channels[ch.id].join('`, `')}\`` 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')
}); });
} }

View File

@ -33,7 +33,7 @@ class Voice extends Setting {
if (opts.enabled) setting.enabled = opts.enabled.value; if (opts.enabled) setting.enabled = opts.enabled.value;
if (opts.channel) setting.channel = opts.channel.value.id; if (opts.channel) setting.channel = opts.channel.value.id;
return { index: 'SETTING_SUCCESS_ALT' }; return { index: 'SETTING_SUCCESS_ALT' };
} }
@ -48,7 +48,7 @@ class Voice extends Setting {
}, },
{ {
name: 'GENERAL_CHANNEL', name: 'GENERAL_CHANNEL',
value: `<#${setting.channel}>`, value: setting.channel ? `<#${setting.channel}>` : '**N/A**',
inline: true inline: true
} }
]; ];

View File

@ -68,7 +68,7 @@ class SettingsMigrator {
// const { _version } = settings; // const { _version } = settings;
// if (!_version) return Promise.reject(new Error('Unable to determine configuration version')); // 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, let webhook = null,
permissions = null; permissions = null;
@ -207,7 +207,6 @@ class SettingsMigrator {
} }
'2'(result) { '2'(result) {
if (result.settings) result = result.settings;
const { moderation, modlogs, muterole, mutetype, automod, wordFilter, ignore, invitefilter, const { moderation, modlogs, muterole, mutetype, automod, wordFilter, ignore, invitefilter,
chatlogs, activity, selfrole, killitwithfire, memberlogs, staffRole, staffRule, modpoints, chatlogs, activity, selfrole, killitwithfire, memberlogs, staffRole, staffRule, modpoints,
userlogs, grantable, privatelog, linkfilter, autorole, welcomer, prefix, protection } = result; userlogs, grantable, privatelog, linkfilter, autorole, welcomer, prefix, protection } = result;