Space after conditionals

This commit is contained in:
Daniel Odendahl Jr
2017-05-08 13:46:36 +00:00
parent 7e20086b2a
commit 8ba552b21a
78 changed files with 313 additions and 379 deletions
+2 -4
View File
@@ -5,9 +5,7 @@ module.exports = class EasterEggCommand extends Command {
constructor(client) {
super(client, {
name: 'easter-egg',
aliases: [
'tag'
],
aliases: ['tag'],
group: 'random',
memberName: 'easter-egg',
description: 'Can you discover all the easter eggs?',
@@ -17,7 +15,7 @@ module.exports = class EasterEggCommand extends Command {
prompt: 'What easter egg do you want to view?',
type: 'string',
validate: tag => {
if(eastereggs[tag.toLowerCase()]) return true;
if (eastereggs[tag.toLowerCase()]) return true;
return 'Nope, that\'s not a valid easter egg. Try again!';
},
parse: tag => tag.toLowerCase()
+4 -4
View File
@@ -15,7 +15,7 @@ module.exports = class MemeCommand extends Command {
prompt: 'What meme type do you want to use?',
type: 'string',
validate: type => {
if(codes.includes(type.toLowerCase())) return true;
if (codes.includes(type.toLowerCase())) return true;
return 'Invalid meme type. Use `help meme` to view a list of meme types.';
},
parse: type => type.toLowerCase()
@@ -37,11 +37,11 @@ module.exports = class MemeCommand extends Command {
}
run(msg, args) {
if(msg.channel.type !== 'dm')
if(!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
if (msg.channel.type !== 'dm')
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
return msg.say('This Command requires the `Attach Files` Permission.');
const { type, top, bottom } = args;
return msg.channel.send({ files: [`https://memegen.link/${type}/${top}/${bottom}.jpg`] })
.catch(err => msg.say(`An Error Occurred: ${err}`));
.catch (err => msg.say(`An Error Occurred: ${err}`));
}
};
+2 -2
View File
@@ -13,8 +13,8 @@ module.exports = class NitroCommand extends Command {
}
run(msg) {
if(msg.channel.type !== 'dm')
if(!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
if (msg.channel.type !== 'dm')
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
return msg.say('This Command requires the `Embed Links` Permission.');
const embed = new RichEmbed()
.setAuthor('Discord Nitro')
+3 -3
View File
@@ -11,10 +11,10 @@ module.exports = class SpamCommand extends Command {
}
run(msg) {
if(msg.channel.type !== 'dm')
if(!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
if (msg.channel.type !== 'dm')
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
return msg.say('This Command requires the `Attach Files` Permission.');
return msg.channel.send({ files: ['https://i.imgur.com/2JFu5xE.jpg'] })
.catch(err => msg.say(`An Error Occurred: ${err}`));
.catch (err => msg.say(`An Error Occurred: ${err}`));
}
};
+5 -5
View File
@@ -15,7 +15,7 @@ module.exports = class StrawpollCommand extends Command {
prompt: 'What would you like the title of the Strawpoll to be?',
type: 'string',
validate: title => {
if(title.length < 200) return true;
if (title.length < 200) return true;
return 'Invalid Title. Title must be under 200 characters.';
}
},
@@ -25,7 +25,7 @@ module.exports = class StrawpollCommand extends Command {
type: 'string',
infinite: true,
validate: choice => {
if(choice.length < 160) return true;
if (choice.length < 160) return true;
return 'Invalid Choice. Choices must be under 140 characters each.';
}
}
@@ -35,8 +35,8 @@ module.exports = class StrawpollCommand extends Command {
async run(msg, args) {
const { title, options } = args;
if(options.length < 2) return msg.say('You provided less than two choices.');
if(options.length > 31) return msg.say('You provided more than thirty choices.');
if (options.length < 2) return msg.say('You provided less than two choices.');
if (options.length > 31) return msg.say('You provided more than thirty choices.');
try {
const { body } = await request
.post('https://strawpoll.me/api/v2/polls')
@@ -45,7 +45,7 @@ module.exports = class StrawpollCommand extends Command {
${body.title}
http://strawpoll.me/${body.id}
`);
} catch(err) {
} catch (err) {
return msg.say(`An Error Occurred: ${err}`);
}
}
+3 -3
View File
@@ -13,8 +13,8 @@ module.exports = class TodayCommand extends Command {
}
async run(msg) {
if(msg.channel.type !== 'dm')
if(!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
if (msg.channel.type !== 'dm')
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
return msg.say('This Command requires the `Embed Links` Permission.');
try {
const { text } = await request
@@ -30,7 +30,7 @@ module.exports = class TodayCommand extends Command {
.setTimestamp()
.setDescription(`${events[random].year}: ${events[random].text}`);
return msg.embed(embed);
} catch(err) {
} catch (err) {
return msg.say(`An Error Occurred: ${err}`);
}
}
+4 -6
View File
@@ -6,9 +6,7 @@ module.exports = class WouldYouRatherCommand extends Command {
constructor(client) {
super(client, {
name: 'would-you-rather',
aliases: [
'wyrather'
],
aliases: ['wyrather'],
group: 'random',
memberName: 'would-you-rather',
description: 'Gets a random would you rather question.'
@@ -16,8 +14,8 @@ module.exports = class WouldYouRatherCommand extends Command {
}
async run(msg) {
if(msg.channel.type !== 'dm')
if(!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
if (msg.channel.type !== 'dm')
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
return msg.say('This Command requires the `Embed Links` Permission.');
try {
const { body } = await request
@@ -28,7 +26,7 @@ module.exports = class WouldYouRatherCommand extends Command {
.setColor(0x9797FF)
.setDescription(`${body.choicea} OR ${body.choiceb}?`);
return msg.embed(embed);
} catch(err) {
} catch (err) {
return msg.say(`An Error Occurred: ${err}`);
}
}