stripIndents

This commit is contained in:
Daniel Odendahl Jr
2017-05-03 01:19:44 +00:00
parent 74fa836044
commit 2ee1f3e594
15 changed files with 100 additions and 79 deletions
+5 -4
View File
@@ -1,5 +1,6 @@
const { Command } = require('discord.js-commando');
const { RichEmbed } = require('discord.js');
const { stripIndents } = require('common-tags');
module.exports = class HelpCommand extends Command {
constructor(client) {
@@ -29,14 +30,14 @@ module.exports = class HelpCommand extends Command {
const showAll = command && command.toLowerCase() === 'all';
if (command && !showAll) {
if (commands.length === 1) {
return msg.say(
`__Command **${commands[0].name}**:__ *${commands[0].description}*
return msg.say(stripIndents`
__Command **${commands[0].name}**:__ *${commands[0].description}*
${commands[0].guildOnly ? 'Usable Only in Servers' : 'Usable in Server and DM'}
**Format:** ${msg.anyUsage(`${commands[0].name}${commands[0].format ? ` ${commands[0].format}` : ''}`)}
**Aliases:** ${commands[0].aliases.join(', ') || 'None'}
**Group:** ${commands[0].group.name}
${commands[0].details || ''}`
);
${commands[0].details || ''}
`);
} else if (commands.length > 1) {
return msg.say('Multiple Commands Found. Please be more specific.');
} else {
+5 -4
View File
@@ -1,4 +1,5 @@
const { Command } = require('discord.js-commando');
const { stripIndents } = require('common-tags');
module.exports = class InviteCommand extends Command {
constructor(client) {
@@ -12,11 +13,11 @@ module.exports = class InviteCommand extends Command {
async run(msg) {
const invite = await this.client.generateInvite('1345846343');
return msg.say(
`Add me to your server with this link:
return msg.say(stripIndents`
Add me to your server with this link:
${invite}
Or, come to my server with this link:
${this.client.options.invite}`
);
${this.client.options.invite}
`);
}
};