mirror of
https://github.com/danbulant/Shasha
synced 2026-05-19 20:18:48 +00:00
30 lines
866 B
JavaScript
30 lines
866 B
JavaScript
const { stripIndents } = require('common-tags');
|
|
const Command = require('../../node_modules/@iceprod/discord.js-commando/src/commands/base');
|
|
|
|
module.exports = class ListGroupsCommand extends Command {
|
|
constructor(client) {
|
|
super(client, {
|
|
name: 'groups',
|
|
aliases: ['list-groups', 'show-groups'],
|
|
group: 'owner',
|
|
memberName: 'groups',
|
|
description: 'Lists all command groups.',
|
|
details: 'Only administrators may use this command.',
|
|
guarded: true
|
|
});
|
|
}
|
|
|
|
hasPermission(msg) {
|
|
if(!msg.guild) return this.client.isOwner(msg.author);
|
|
return msg.member.permissions.has('ADMINISTRATOR') || this.client.isOwner(msg.author);
|
|
}
|
|
|
|
run(msg) {
|
|
return msg.reply(stripIndents`
|
|
__**Groups**__
|
|
${this.client.registry.groups.map(grp =>
|
|
`**${grp.name}:** ${grp.isEnabledIn(msg.guild) ? 'Enabled' : 'Disabled'}`
|
|
).join('\n')}
|
|
`);
|
|
}
|
|
};
|