Add permissions to help command

This commit is contained in:
Dragon Fire
2020-05-05 18:21:46 -04:00
parent ec779f2a68
commit 0c5ca9f7b7
2 changed files with 10 additions and 1 deletions
+9
View File
@@ -1,5 +1,6 @@
const Command = require('../../structures/Command');
const { MessageEmbed } = require('discord.js');
const { util: { permissions } } = require('discord.js-commando');
const { stripIndents } = require('common-tags');
module.exports = class HelpCommand extends Command {
@@ -56,6 +57,12 @@ module.exports = class HelpCommand extends Command {
return msg.reply('Failed to send DM. You probably have DMs disabled.');
}
}
const userPerms = command.userPermissions
? command.userPermissions.map(perm => permissions[perm]).join(', ')
: 'None';
const clientPerms = command.clientPermissions
? command.clientPermissions.map(perm => permissions[perm]).join(', ')
: 'None';
return msg.say(stripIndents`
__Command **${command.name}**__${command.guildOnly ? ' (Usable only in servers)' : ''}
${command.description}${command.details ? `\n${command.details}` : ''}
@@ -64,6 +71,8 @@ module.exports = class HelpCommand extends Command {
**Aliases:** ${command.aliases.join(', ') || 'None'}
**Group:** ${command.group.name} (\`${command.groupID}:${command.memberName}\`)
**NSFW:** ${command.nsfw ? 'Yes' : 'No'}
**Permissions You Need:** ${userPerms}
**Permissions I Need:** ${clientPerms}
`);
}
};
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "114.5.5",
"version": "114.5.6",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {