mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-08 07:11:49 +02:00
Add permissions to help command
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
const Command = require('../../structures/Command');
|
const Command = require('../../structures/Command');
|
||||||
const { MessageEmbed } = require('discord.js');
|
const { MessageEmbed } = require('discord.js');
|
||||||
|
const { util: { permissions } } = require('discord.js-commando');
|
||||||
const { stripIndents } = require('common-tags');
|
const { stripIndents } = require('common-tags');
|
||||||
|
|
||||||
module.exports = class HelpCommand extends Command {
|
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.');
|
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`
|
return msg.say(stripIndents`
|
||||||
__Command **${command.name}**__${command.guildOnly ? ' (Usable only in servers)' : ''}
|
__Command **${command.name}**__${command.guildOnly ? ' (Usable only in servers)' : ''}
|
||||||
${command.description}${command.details ? `\n${command.details}` : ''}
|
${command.description}${command.details ? `\n${command.details}` : ''}
|
||||||
@@ -64,6 +71,8 @@ module.exports = class HelpCommand extends Command {
|
|||||||
**Aliases:** ${command.aliases.join(', ') || 'None'}
|
**Aliases:** ${command.aliases.join(', ') || 'None'}
|
||||||
**Group:** ${command.group.name} (\`${command.groupID}:${command.memberName}\`)
|
**Group:** ${command.group.name} (\`${command.groupID}:${command.memberName}\`)
|
||||||
**NSFW:** ${command.nsfw ? 'Yes' : 'No'}
|
**NSFW:** ${command.nsfw ? 'Yes' : 'No'}
|
||||||
|
**Permissions You Need:** ${userPerms}
|
||||||
|
**Permissions I Need:** ${clientPerms}
|
||||||
`);
|
`);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiao",
|
"name": "xiao",
|
||||||
"version": "114.5.5",
|
"version": "114.5.6",
|
||||||
"description": "Your personal server companion.",
|
"description": "Your personal server companion.",
|
||||||
"main": "Xiao.js",
|
"main": "Xiao.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user