1
0
Fork 0

fix: detailed help command permissions

master
Hiroyuki 2021-09-12 21:31:31 -04:00
parent f4f5fdf381
commit 7fd95aa586
No known key found for this signature in database
GPG Key ID: AF65958B7B7362E6
1 changed files with 2 additions and 2 deletions

View File

@ -46,9 +46,9 @@ export default class Help extends Command {
if (!resolved) return message.channel.send(`${this.client.stores.emojis.error} **Command not found!**`);
const { cmd } = resolved;
const perms: string[] = [];
let allowedRoles = cmd.permissions && cmd.permissions.roles && cmd.permissions.roles.map((r) => r.toString()).join(', ');
let allowedRoles = cmd.permissions && cmd.permissions.roles && cmd.permissions.roles.map((r) => `<@&${r}>`).join(', ');
if (allowedRoles) { allowedRoles = `**Roles:** ${allowedRoles}`; perms.push(allowedRoles); }
let allowedUsers = cmd.permissions && cmd.permissions.users && cmd.permissions.users.map((u) => u.toString()).join(', ');
let allowedUsers = cmd.permissions && cmd.permissions.users && cmd.permissions.users.map((u) => `<@!${u}>`).join(', ');
if (allowedUsers) { allowedUsers = `**Users:** ${allowedUsers}`; perms.push(allowedUsers); }
const displayedPerms = perms.length ? `\n**Permissions:**\n${perms.join('\n')}` : '';
const aliases = cmd.aliases.length ? `\n**Aliases:** ${cmd.aliases.map((alias) => `${this.client.config.prefix}${cmd.parentName ? `${cmd.parentName} ` : ''}${alias}`).join(', ')}` : '';