Update webhooks
This commit is contained in:
14
src/index.js
14
src/index.js
@@ -34,9 +34,15 @@ const credentials = {
|
||||
cert: certificate,
|
||||
};
|
||||
|
||||
const callWebhooks = () => {
|
||||
config?.triggerWebhooks?.forEach((webhook) => {
|
||||
axios.get(webhook);
|
||||
});
|
||||
}
|
||||
|
||||
let bot = null;
|
||||
|
||||
const messageIDs = [1034133487, 6745312374];
|
||||
const messageIDs = config.telegrammessageIDs || [];
|
||||
|
||||
function sendMessage(msg, idList) {
|
||||
idList.forEach((id) => {
|
||||
@@ -44,6 +50,7 @@ function sendMessage(msg, idList) {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
if (config.activate_telegram) {
|
||||
const token = "6150769224:AAGhBagPEi23QtBJl65YNuwEBBXwHguDV0E";
|
||||
|
||||
@@ -145,8 +152,9 @@ async function main(data) {
|
||||
if (config.activate_telegram) {
|
||||
sendMessage("[INFO]: Einsatdepesche wird Gedruckt - " + data.title, messageIDs);
|
||||
}
|
||||
axios.get("https://maker.ifttt.com/trigger/Einsatz/with/key/f4QUHDvvWTG9dOdTyBDDRMc2jxUCM-AUPpm7TkyKwQ_")
|
||||
axios.get("https://maker.ifttt.com/trigger/Alarm/with/key/mDrKtS60Xz-BNP_XfBLFH5hZU_vGiBW6KlPSe6iP61f")
|
||||
|
||||
callWebhooks();
|
||||
|
||||
const filePath = cacheFolder + data.foreign_id + ".pdf";
|
||||
await createPDF({ filePath, ...data });
|
||||
console.log("PDF created, printing now");
|
||||
|
||||
Reference in New Issue
Block a user