From 26ede2a8ffb40337d3219851def00582626621e3 Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Sat, 1 May 2021 23:24:51 -0500 Subject: [PATCH] Attempt to fix scope issue --- bot/awesomescibo.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/bot/awesomescibo.js b/bot/awesomescibo.js index e6fecba..77c5fcb 100755 --- a/bot/awesomescibo.js +++ b/bot/awesomescibo.js @@ -355,17 +355,19 @@ async function generateRound(message) { bonus_answer + "

"; htmlContent = htmlContent.replace(/\n/g, "
"); + if (i === 25) { + newGeneratedRound = new generatedRound({ + htmlContent: htmlContent, + requestedBy: message.author.tag, + }); + newGeneratedRound.save((err) => + err + ? console.log("Error creating saving generated round content") + : console.log("Sucessfully created new entry for the generated round") + ); + } }); } - newGeneratedRound = new generatedRound({ - htmlContent: htmlContent, - requestedBy: message.author.tag, - }); - newGeneratedRound.save((err) => - err - ? console.log("Error creating saving generated round content") - : console.log("Sucessfully created new entry for the generated round") - ); message.channel.send("Check database"); }