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
+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}`);
}
}