mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-03-11 06:05:16 +08:00
added daily lb announce
This commit is contained in:
parent
bf050a8d6c
commit
865bfc3dea
1 changed files with 10 additions and 0 deletions
|
@ -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(),
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue