fixed bug that made it crash every 1000

This commit is contained in:
Avi 2020-09-29 00:13:31 +00:00
parent 145fc1bc3d
commit 30f9cff116
3 changed files with 3 additions and 3 deletions

View file

@ -1,2 +1,2 @@
language = "nodejs" language = "nodejs"
run = "node app.js" run = "node api/app.js"

View file

@ -135,7 +135,7 @@ async function getStats() {
async function report() { async function report() {
let oldest = await fetchOldest(channel); let oldest = await fetchOldest(channel);
latest = await fetchLatest(channel); let latest = await fetchLatest(channel);
let diff = latest - oldest; let diff = latest - oldest;
addData('increase', { addData('increase', {
"Date": moment().subtract(1, "days").format("YYYY-MM-DD"), "Date": moment().subtract(1, "days").format("YYYY-MM-DD"),
@ -170,7 +170,7 @@ async function report() {
" *" + " *" +
tenThousandsTime + tenThousandsTime +
"* \n :fastparrot: KEEP IT GOING GUYS!"; "* \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; let messageWithCelebration = ":tada: YAY! We've went past " + pastThousandsGoal + "! :tada: \n" + message;
publishMessage(channel, messageWithCelebration); //'C017W4PHYKS' for debugging, channel for actual publishMessage(channel, messageWithCelebration); //'C017W4PHYKS' for debugging, channel for actual
} else { } else {