forked from engineering/cloudservices
fix: help command permissions parsing
parent
12aab5aa56
commit
f4f5fdf381
|
@ -20,9 +20,9 @@ export default class Help extends Command {
|
|||
const commands = this.client.commands.map((c) => {
|
||||
const aliases = c.aliases.map((alias) => `${this.client.config.prefix}${alias}`).join(', ');
|
||||
const perms: string[] = [];
|
||||
let allowedRoles = c.permissions && c.permissions.roles && c.permissions.roles.map((r) => r.toString()).join(', ');
|
||||
let allowedRoles = c.permissions && c.permissions.roles && c.permissions.roles.map((r) => `<@&${r}>`).join(', ');
|
||||
if (allowedRoles) { allowedRoles = `**Roles:** ${allowedRoles}`; perms.push(allowedRoles); }
|
||||
let allowedUsers = c.permissions && c.permissions.users && c.permissions.users.map((u) => u.toString()).join(', ');
|
||||
let allowedUsers = c.permissions && c.permissions.users && c.permissions.users.map((u) => `<@!${u}>`).join(', ');
|
||||
if (allowedUsers) { allowedUsers = `**Users:** ${allowedUsers}`; perms.push(allowedUsers); }
|
||||
const displayedPerms = perms.length ? `**Permissions:**\n${perms.join('\n')}` : '';
|
||||
return { name: `${this.client.config.prefix}${c.name}`, value: `**Description:** ${c.description}\n**Aliases:** ${aliases}\n**Usage:** ${c.usage}\n${displayedPerms}`, inline: false };
|
||||
|
|
Loading…
Reference in New Issue