Skip to content

Commit

Permalink
✨ Add Lark Provider
Browse files Browse the repository at this point in the history
  • Loading branch information
fuergaosi233 committed Feb 21, 2022
1 parent 7060a19 commit b620bc2
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/helpers/notifme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,4 +244,30 @@ export const sendNotification = async (message: string) => {
}
console.log("Finished sending Telegram");
}
if (getSecret("NOTIFICATION_LARK")) {
console.log("Sending Lark");
try {
await axios.post(
`${getSecret("NOTIFICATION_LARK_BOT_WEBHOOK")}`,
{
"msg_type": "interactive",
"card": {
"config": {
"wide_screen_mode": true
},
"elements": [
{
"tag": "markdown",
"content": message.replace(/_/g, '\\_'),
}
]
}
}
);
console.log("Success Lark");
} catch (error) {
console.log("Got an error", error);
}
console.log("Finished sending Lark");
}
};

0 comments on commit b620bc2

Please sign in to comment.