fuck python, switching to apprise-api as a docker container
This commit is contained in:
28
src/app.ts
28
src/app.ts
@@ -112,11 +112,29 @@ async function main( ) {
|
||||
}
|
||||
return false;
|
||||
})( ev );
|
||||
await sendNotification(
|
||||
`${today_prefix ? "TODAY " : ""}${notification_prefix ? notification_prefix + ": " : ""} ${ev.title} (${ TEventType[ ev.event_type ] })`,
|
||||
`${body}`
|
||||
// `${ev.link || "https://77th-jsoc.com/#/events"}`
|
||||
);
|
||||
const title = `${today_prefix ? "TODAY " : ""}${notification_prefix ? notification_prefix + ": " : ""} ${ev.title} (${ TEventType[ ev.event_type ] })`;
|
||||
|
||||
await fetch("http://localhost:8000/notify", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify({
|
||||
urls: [
|
||||
`ntfys://${process.env.ntfy_username}:${process.env.ntfy_password}@${process.env.ntfy_host}/${process.env.ntfy_topic}${ ev.link ? `?click=${ev.link}`: "?click=https://77th-jsoc.com/#/events" }`,
|
||||
`discord://${process.env.dc_webhook}?avatar_url=${process.env.dc_avatar_url}&botname=${process.env.dc_botname}`
|
||||
].join(","),
|
||||
title: title,
|
||||
body: body,
|
||||
format: "text"
|
||||
})
|
||||
});
|
||||
|
||||
// await sendNotification(
|
||||
// title,
|
||||
// body
|
||||
// // `${ev.link || "https://77th-jsoc.com/#/events"}`
|
||||
// );
|
||||
ev.set_notification("done", db);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user