The Power of const

This commit is contained in:
Daniel Odendahl Jr
2017-04-03 22:31:19 +00:00
parent 4f0f1b4ad2
commit 76907549df
87 changed files with 525 additions and 558 deletions
+4 -4
View File
@@ -45,18 +45,18 @@ module.exports = class StrawpollCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let title = args.title;
let choices = args.choices.split(" | ");
const title = args.title;
const choices = args.choices.split(" | ");
if (choices.length < 2) return message.say(':x: Error! You provided less than two choices!');
if (choices.length > 31) return message.say(':x: Error! You provided more than thirty choices!');
try {
let response = await request
const response = await request
.post('https://strawpoll.me/api/v2/polls')
.send({
title: title,
options: choices
});
let data = response.body;
const data = response.body;
return message.say(`${data.title}\nhttp://strawpoll.me/${data.id}`);
}
catch (err) {