From 20d927f5583832a1b70ba628f11d067dd02ba624 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Fri, 24 Mar 2017 12:34:33 +0000 Subject: [PATCH] Remove HTML Tags in Quiz Answers --- commands/random/quiz.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/commands/random/quiz.js b/commands/random/quiz.js index 42bd8501..f5f557a0 100644 --- a/commands/random/quiz.js +++ b/commands/random/quiz.js @@ -27,20 +27,21 @@ module.exports = class QuizCommand extends commando.Command { .query({ count: 1 }); + let answer = response.body[0].answer.toLowerCase().split("").join("").split("").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}`); let embedMsg = await message.channel.sendEmbed(embed); try { - let collected = await message.channel.awaitMessages(res => res.content.toLowerCase() === response.body[0].answer.toLowerCase() && res.author.id === message.author.id, { + let collected = await message.channel.awaitMessages(res => res.content.toLowerCase() === answer && res.author.id === message.author.id, { max: 1, time: 15000, errors: ['time'] }); - return message.channel.send(`Good Job! You won! ${response.body[0].answer} is the correct answer!`); + return message.channel.send(`Good Job! You won! ${answer} is the correct answer!`); } catch (err) { - return message.channel.send(`Aw... Too bad, try again next time!\nThe Correct Answer was: ${response.body[0].answer}`); + return message.channel.send(`Aw... Too bad, try again next time!\nThe Correct Answer was: ${answer}`); } } catch (err) {