From 7eaee053193125876bd70326003e191025533efa Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Sat, 1 May 2021 23:27:20 -0500 Subject: [PATCH] Add HTML content for each question to separate variable for full round --- bot/awesomescibo.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bot/awesomescibo.js b/bot/awesomescibo.js index 77c5fcb..9d30e8d 100755 --- a/bot/awesomescibo.js +++ b/bot/awesomescibo.js @@ -321,6 +321,7 @@ async function generateRound(message) { let bonus_question; let bonus_format; let bonus_answer; + let finalizedHTML = ""; let htmlContent = ""; await fetch("https://scibowldb.com/api/questions/random") .then((response) => response.json()) @@ -355,10 +356,11 @@ async function generateRound(message) { bonus_answer + "

"; htmlContent = htmlContent.replace(/\n/g, "
"); + finalizedHTML += htmlContent; if (i === 25) { newGeneratedRound = new generatedRound({ - htmlContent: htmlContent, - requestedBy: message.author.tag, + htmlContent: finalizedHTML, + requestedBy: message.author.id, }); newGeneratedRound.save((err) => err