eslint config aqua

This commit is contained in:
Daniel Odendahl Jr
2017-07-27 21:00:54 +00:00
parent 93fd5f6caa
commit 53e1d6a8ff
176 changed files with 6713 additions and 7642 deletions
+59 -59
View File
@@ -3,64 +3,64 @@ const { MessageEmbed } = require('discord.js');
const { stripIndents } = require('common-tags');
module.exports = class HelpCommand extends Command {
constructor(client) {
super(client, {
name: 'help',
aliases: ['commands'],
group: 'util',
memberName: 'help',
description: 'Displays a list of available commands, or detailed information for a specified command.',
guarded: true,
clientPermissions: ['EMBED_LINKS'],
args: [
{
key: 'command',
prompt: 'Which command would you like to view the help for?',
type: 'string',
default: ''
}
]
});
}
constructor(client) {
super(client, {
name: 'help',
aliases: ['commands'],
group: 'util',
memberName: 'help',
description: 'Displays a list of available commands, or detailed information for a specified command.',
guarded: true,
clientPermissions: ['EMBED_LINKS'],
args: [
{
key: 'command',
prompt: 'Which command would you like to view the help for?',
type: 'string',
default: ''
}
]
});
}
async run(msg, args) {
const { command } = args;
const commands = this.client.registry.findCommands(command, false, msg);
if (command) {
if (commands.length === 1) {
const embed = new MessageEmbed()
.setTitle(`Command ${commands[0].name}`)
.setDescription(stripIndents`
${commands[0].description}
${commands[0].details || ''}
`)
.addField(' Format',
msg.anyUsage(`${commands[0].name} ${commands[0].format ? commands[0].format : ''}`))
.addField(' Aliases',
commands[0].aliases.join(', ') || 'None')
.addField(' Group',
commands[0].group.name);
return msg.embed(embed);
} else if (commands.length > 1) {
return msg.say(`Multiple commands found: ${commands.map((c) => c.name).join(', ')}`);
} else {
return msg.say(`Could not identify command. Use ${msg.usage(null)} to view a list of commands.`);
}
} else {
const embed = new MessageEmbed()
.setTitle('Command List')
.setDescription(`Use ${msg.usage('<command>')} to view detailed information about a command.`)
.setColor(0x00AE86);
for (const group of this.client.registry.groups.values()) {
embed.addField(` ${group.name}`,
group.commands.map((c) => c.name).join(', ') || 'None');
}
try {
await msg.direct({ embed });
return msg.say(':mailbox_with_mail: Sent you a DM with information.');
} catch (err) {
return msg.say('Failed to send DM. You probably have DMs disabled.');
}
}
}
async run(msg, args) {
const { command } = args;
const commands = this.client.registry.findCommands(command, false, msg);
if (command) {
if (commands.length === 1) {
const embed = new MessageEmbed()
.setTitle(`Command ${commands[0].name}`)
.setDescription(stripIndents`
${commands[0].description}
${commands[0].details || ''}
`)
.addField(' Format',
msg.anyUsage(`${commands[0].name} ${commands[0].format ? commands[0].format : ''}`))
.addField(' Aliases',
commands[0].aliases.join(', ') || 'None')
.addField(' Group',
commands[0].group.name);
return msg.embed(embed);
} else if (commands.length > 1) {
return msg.say(`Multiple commands found: ${commands.map(c => c.name).join(', ')}`);
} else {
return msg.say(`Could not identify command. Use ${msg.usage(null)} to view a list of commands.`);
}
} else {
const embed = new MessageEmbed()
.setTitle('Command List')
.setDescription(`Use ${msg.usage('<command>')} to view detailed information about a command.`)
.setColor(0x00AE86);
for (const group of this.client.registry.groups.values()) {
embed.addField(` ${group.name}`,
group.commands.map(c => c.name).join(', ') || 'None');
}
try {
await msg.direct({ embed });
return msg.say(':mailbox_with_mail: Sent you a DM with information.');
} catch (err) {
return msg.say('Failed to send DM. You probably have DMs disabled.');
}
}
}
};