Shinobi/libs/notification.js

20 lines
999 B
JavaScript
Raw Normal View History

var fs = require("fs")
2018-09-28 20:26:24 +00:00
module.exports = function(s,config,lang){
async function getSnapshot(d,monitorConfig){
d.screenshotBuffer = d.screenshotBuffer || d.frame
if(!d.screenshotBuffer || (monitorConfig.details.notify_useRawSnapshot === '1' && !d.usingRawSnapshotBuffer)){
d.usingRawSnapshotBuffer = true
const { screenShot, isStaticFile } = await s.getRawSnapshotFromMonitor(monitorConfig,{
secondsInward: monitorConfig.details.snap_seconds_inward
})
d.screenshotBuffer = screenShot
}
}
require('./notifications/email.js')(s,config,lang,getSnapshot)
require('./notifications/discordBot.js')(s,config,lang,getSnapshot)
require('./notifications/telegram.js')(s,config,lang,getSnapshot)
2021-07-18 19:36:09 +00:00
require('./notifications/pushover.js')(s,config,lang,getSnapshot)
require('./notifications/webhook.js')(s,config,lang,getSnapshot)
2021-11-15 18:19:31 +00:00
require('./notifications/mqtt.js')(s,config,lang,getSnapshot)
2018-09-28 05:37:08 +00:00
}