diff --git a/.replit b/.replit index ff4f78c..0da8d41 100644 --- a/.replit +++ b/.replit @@ -1,2 +1,2 @@ language = "nodejs" -run = "node app.js" \ No newline at end of file +run = "node api/app.js" \ No newline at end of file diff --git a/app.js b/api/app.js similarity index 97% rename from app.js rename to api/app.js index 89bf466..0195deb 100644 --- a/app.js +++ b/api/app.js @@ -135,7 +135,7 @@ async function getStats() { async function report() { let oldest = await fetchOldest(channel); - latest = await fetchLatest(channel); + let latest = await fetchLatest(channel); let diff = latest - oldest; addData('increase', { "Date": moment().subtract(1, "days").format("YYYY-MM-DD"), @@ -170,7 +170,7 @@ async function report() { " *" + tenThousandsTime + "* \n :fastparrot: KEEP IT GOING GUYS!"; - if (pastThousandsGoal > oldest && pastThousandsGoal <= newest) { + if (pastThousandsGoal > oldest && pastThousandsGoal <= latest) { let messageWithCelebration = ":tada: YAY! We've went past " + pastThousandsGoal + "! :tada: \n" + message; publishMessage(channel, messageWithCelebration); //'C017W4PHYKS' for debugging, channel for actual } else { diff --git a/keep_alive.js b/api/keep_alive.js similarity index 100% rename from keep_alive.js rename to api/keep_alive.js