This commit is contained in:
Daniel Odendahl Jr
2017-03-23 21:03:22 +00:00
parent 6457b9468c
commit 47f9a41854
+3 -3
View File
@@ -29,16 +29,16 @@ module.exports = class QuizCommand extends commando.Command {
.then(function(response) {
const embed = new Discord.RichEmbed()
.setTitle('You have **fifteen** seconds to answer this question:')
.setDescription(`**Category: ${response.body.category}**\n${response.body.question}`);
.setDescription(`**Category: ${response.body[0].category}**\n${response.body[0].question}`);
message.channel.sendEmbed(embed).then(() => {
message.channel.awaitMessages(res => res.content.toLowerCase() === response.body.answer.toLowerCase() && res.author.id === message.author.id, {
message.channel.awaitMessages(res => res.content.toLowerCase() === response.body[0].answer.toLowerCase() && res.author.id === message.author.id, {
max: 1,
time: 15000,
errors: ['time'],
}).then((collected) => {
return message.channel.send(`Good Job! You won!`);
}).catch(() => {
return message.channel.send(`Aw... Too bad, try again next time!\nThe Correct Answer was: ${response.body.answer}`);
return message.channel.send(`Aw... Too bad, try again next time!\nThe Correct Answer was: ${response.body[0].answer}`);
});
}).catch(function(err) {
console.log(err);