Change in the way Requests work

This commit is contained in:
Daniel Odendahl Jr
2017-04-03 20:38:18 +00:00
parent 0d05032bb3
commit 06e1cd9c50
18 changed files with 213 additions and 118 deletions
+3 -2
View File
@@ -27,10 +27,11 @@ module.exports = class QuizCommand extends commando.Command {
.query({
count: 1
});
let answer = response.body[0].answer.toLowerCase().split("<i>").join("").split("</i>").join("");
let data = response.body[0];
let answer = data.answer.toLowerCase().split("<i>").join("").split("</i>").join("");
const embed = new Discord.RichEmbed()
.setTitle('You have **fifteen** seconds to answer this question:')
.setDescription(`**Category: ${response.body[0].category.title}**\n${response.body[0].question}`);
.setDescription(`**Category: ${data.category.title}**\n${data.question}`);
let embedMsg = await message.embed(embed);
try {
let collected = await message.channel.awaitMessages(res => res.author.id === message.author.id, {