mirror of
https://github.com/System-End/slack-end.git
synced 2026-04-19 22:05:10 +00:00
fix: date moment + add cron job
This commit is contained in:
parent
1fed8532fe
commit
daeb78b8f0
2 changed files with 9 additions and 1 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import { Cron } from "croner";
|
||||
import { ModifiedApp } from "./slackapp";
|
||||
|
||||
// time to get fudge pt 2
|
||||
|
|
@ -36,7 +37,7 @@ const strings = []
|
|||
}
|
||||
const daysDiffLength = user.days.length - oldUser.days.length
|
||||
if(daysDiffLength > 0) {
|
||||
strings.push(`:yay: ${user.username} has moved up to ${user.days.length + 1} days!`)
|
||||
strings.push(`:yay: ${user.username} has is now at ${user.days.length} days!`)
|
||||
}
|
||||
}
|
||||
return strings
|
||||
|
|
@ -54,4 +55,9 @@ app.client.chat.postMessage({
|
|||
text: `Diff for \`${new Date().toISOString()}\` (EST)\n\n${strings.join('\n')}`
|
||||
})
|
||||
}
|
||||
}
|
||||
export function cronJobFor15daysofcode(app: ModifiedApp) {
|
||||
new Cron("*/15 * * * *", async () => {
|
||||
await cronMoment(app)
|
||||
})
|
||||
}
|
||||
|
|
@ -14,6 +14,7 @@ import { highSeasCron } from "./highseas";
|
|||
import { Cron } from "croner";
|
||||
import { setupCron } from "./juice";
|
||||
import { tempcronjob } from "./school";
|
||||
import { cronJobFor15daysofcode } from "./15daysofcode";
|
||||
|
||||
const cronWithCheckIn = Sentry.cron.instrumentNodeCron(cron);
|
||||
|
||||
|
|
@ -269,6 +270,7 @@ export function setupOverallCron(app: ModifiedApp) {
|
|||
// highSeasCron(app);
|
||||
// temp? nah perm now
|
||||
tempcronjob(app);
|
||||
cronJobFor15daysofcode(app);
|
||||
return {
|
||||
// checkAirtableBoba,
|
||||
cronWithCheckIn,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue