From 865bfc3deaef1c046f91ed7a628f4d682367d6a6 Mon Sep 17 00:00:00 2001 From: Jack Date: Sat, 11 Jul 2020 10:53:04 +0100 Subject: [PATCH] added daily lb announce --- functions/index.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/functions/index.js b/functions/index.js index a6e7522ab..a47a80d3d 100644 --- a/functions/index.js +++ b/functions/index.js @@ -1232,6 +1232,7 @@ exports.scheduledFunctionCrontab = functions.pubsub .then((res) => { res.docs.forEach((doc) => { let lbdata = doc.data(); + announceDailyLbResult(lbdata); t = new Date(); db.collection("leaderboards_history") .doc( @@ -1262,3 +1263,12 @@ async function announceLbUpdate(discordId, pos, lb, wpm) { requestTimestamp: Date.now(), }); } + +async function announceDailyLbResult(lbdata) { + db.collection("bot-commands").add({ + command: "announceDailyLbResult", + arguments: [lbdata], + executed: false, + requestTimestamp: Date.now(), + }); +}