mirror of
https://github.com/System-End/slack-end.git
synced 2026-04-19 22:05:10 +00:00
fix: istg if doesnt work
This commit is contained in:
parent
d906f1c9cd
commit
9fce24a521
2 changed files with 24 additions and 1 deletions
18
src/index.ts
18
src/index.ts
|
|
@ -10,7 +10,7 @@ import { View } from "@slack/bolt";
|
|||
import Loader from "./modules/CommandLoader";
|
||||
import path from "path";
|
||||
import JSONdb from "simple-json-db";
|
||||
|
||||
import cron from "node-cron"
|
||||
import * as utils from "./modules/index";
|
||||
import howWasYourDay, {
|
||||
cached_spotify_songs,
|
||||
|
|
@ -84,5 +84,21 @@ function handleError(e: any) {
|
|||
} catch (e) {}
|
||||
}
|
||||
setupOverallCron(app);
|
||||
// im going parinoiddd
|
||||
cron.schedule(
|
||||
"30 21 * * *",
|
||||
async () => {
|
||||
try {
|
||||
await howWasYourDay(app);
|
||||
} catch (e: any) {
|
||||
// uh guess what this doesnt run because this cron doesnt run ...
|
||||
app.client.chat.postMessage({
|
||||
channel: `C07R8DYAZMM`,
|
||||
text: `So i was supposed to say How was your day neon right?? well guess what neon broke my damn code!! so he gets to deal with this shitty error: \`\`\`\n${e.stack}\`\`\``,
|
||||
});
|
||||
}
|
||||
},
|
||||
{ name: "howwasmyday" },
|
||||
);
|
||||
process.on("unhandledRejection", handleError);
|
||||
process.on("unhandledException", handleError);
|
||||
|
|
|
|||
|
|
@ -99,6 +99,7 @@ export function setupOverallCron(app: ModifiedApp) {
|
|||
// at home? at school?
|
||||
// set away if in any focus mode
|
||||
});
|
||||
try {
|
||||
cronWithCheckIn.schedule(
|
||||
"30 21 * * *",
|
||||
async () => {
|
||||
|
|
@ -114,6 +115,12 @@ export function setupOverallCron(app: ModifiedApp) {
|
|||
},
|
||||
{ name: "howwasmyday" },
|
||||
);
|
||||
} catch (e) {
|
||||
app.client.chat.postMessage({
|
||||
channel: `C07R8DYAZMM`,
|
||||
text: `So i was supposed to say How was your day neon right?? well guess what neon broke my damn code!! so he gets to deal with this shitty error: \`\`\`\n${e.stack}\`\`\``,
|
||||
});
|
||||
}
|
||||
cronWithCheckIn.schedule(
|
||||
"1 7 * * 1-5",
|
||||
async () => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue