1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-22 22:59:44 +02:00

feat: Telegram bot notifications (#928)

This commit is contained in:
Elllone 2024-10-31 00:11:52 +03:00 committed by GitHub
parent 1d2193c381
commit cc95032e74
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 113 additions and 6 deletions

View file

@ -2,6 +2,10 @@ const buildAndSendMessage = async (card, actorUser, send) => {
await send(`*${card.name}* was deleted by ${actorUser.name}`);
};
const buildAndSendMessageForTelegramBot = async (card, actorUser, send) => {
await send(`<b>${card.name}</b> was deleted by ${actorUser.name}`);
};
module.exports = {
inputs: {
record: {
@ -59,6 +63,14 @@ module.exports = {
buildAndSendMessage(card, inputs.actorUser, sails.helpers.utils.sendSlackMessage);
}
if (sails.config.custom.telegramChatId) {
buildAndSendMessageForTelegramBot(
card,
inputs.actorUser,
sails.helpers.utils.sendTelegramMessage,
);
}
if (sails.config.custom.googleChatWebhookUrl) {
buildAndSendMessage(card, inputs.actorUser, sails.helpers.utils.sendGoogleChatMessage);
}