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(), + }); +}