added daily lb announce

This commit is contained in:
Jack 2020-07-11 10:53:04 +01:00
parent bf050a8d6c
commit 865bfc3dea

View file

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