mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-25 06:42:51 +02:00
Space after conditionals
This commit is contained in:
@@ -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}`);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user