2019-01-01 19:23:43 +00:00
|
|
|
var fs = require("fs")
|
2018-09-28 20:26:24 +00:00
|
|
|
module.exports = function(s,config,lang){
|
2021-07-03 02:39:57 +00:00
|
|
|
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)
|
2021-10-24 00:27:45 +00:00
|
|
|
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
|
|
|
}
|