tweaking permissions command output

This commit is contained in:
Erik 2022-07-29 12:09:12 +03:00
parent eb5c989e88
commit 9dcdfdc403
Signed by untrusted user: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB
3 changed files with 13 additions and 0 deletions

View File

@ -44,6 +44,9 @@ Global permissions
[COMMAND_PERMISSIONS_SHOW_TITLE]
Granted permissions
[COMMAND_PERMISSIONS_DESC]
Showing permissions {forin} **{target}**
[COMMAND_PERMISSIONS_NO_PERMS]
No permissions granted

View File

@ -134,3 +134,11 @@ switch({toggle}) {
'off';
break;
}
[FOR_IN_TOGGLE]
switch({toggle}) {
case true:
'for'; break;
case false:
'in'; break;
}

View File

@ -235,6 +235,7 @@ class PermissionsCommand extends SlashCommand {
const fields = [];
let update = false;
const target = member?.value || role?.value || channel?.value;
if (member || role) {
@ -342,6 +343,7 @@ class PermissionsCommand extends SlashCommand {
if(!fields.length) return { index: 'COMMAND_PERMISSIONS_NO_PERMS' };
const embed = {
description: target ? interaction.format('COMMAND_PERMISSIONS_DESC', { target: target.tag || target.name || 'any', forin: interaction.format('FOR_IN_TOGGLE', { toggle: target.type === undefined }, { code: true }) }) : '',
title: interaction.format('COMMAND_PERMISSIONS_SHOW_TITLE'),
fields: [ ]
};