feat(notifications): add lark webhook

This commit is contained in:
ischanx
2025-09-24 00:14:06 +08:00
parent 569d43ae7f
commit b4a3cbdff4
16 changed files with 7591 additions and 47 deletions

View File

@@ -1,6 +1,7 @@
import type {
discord,
email,
lark,
gotify,
ntfy,
slack,
@@ -151,3 +152,18 @@ export const sendNtfyNotification = async (
throw new Error(`Failed to send ntfy notification: ${response.statusText}`);
}
};
export const sendLarkNotification = async (
connection: typeof lark.$inferInsert,
message: any,
) => {
try {
await fetch(connection.webhookUrl, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(message),
});
} catch (err) {
console.log(err);
}
};