Make snapshot for Notification come before Video

ejs-templating-update
Moe 2022-07-24 07:35:12 -07:00
parent f6ebf13b17
commit 0444dc9889
4 changed files with 49 additions and 49 deletions

View File

@ -66,6 +66,28 @@ module.exports = function(s,config,lang,getSnapshot){
clearTimeout(s.group[d.ke].activeMonitors[d.id].detector_discordbot);
s.group[d.ke].activeMonitors[d.id].detector_discordbot = null
},detector_discordbot_timeout)
await getSnapshot(d,monitorConfig)
if(d.screenshotBuffer){
sendMessage({
author: {
name: s.group[d.ke].rawMonitorConfigurations[d.id].name,
icon_url: config.iconURL
},
title: lang.Event+' - '+d.screenshotName,
description: lang.EventText1+' '+d.currentTimestamp,
fields: [],
timestamp: d.currentTime,
footer: {
icon_url: config.iconURL,
text: "Shinobi Systems"
}
},[
{
attachment: d.screenshotBuffer,
name: d.screenshotName+'.jpg'
}
],d.ke)
}
if(monitorConfig.details.detector_discordbot_send_video === '1'){
let videoPath = null
let videoName = null
@ -102,28 +124,6 @@ module.exports = function(s,config,lang,getSnapshot){
],d.ke)
}
}
await getSnapshot(d,monitorConfig)
if(d.screenshotBuffer){
sendMessage({
author: {
name: s.group[d.ke].rawMonitorConfigurations[d.id].name,
icon_url: config.iconURL
},
title: lang.Event+' - '+d.screenshotName,
description: lang.EventText1+' '+d.currentTimestamp,
fields: [],
timestamp: d.currentTime,
footer: {
icon_url: config.iconURL,
text: "Shinobi Systems"
}
},[
{
attachment: d.screenshotBuffer,
name: d.screenshotName+'.jpg'
}
],d.ke)
}
}
}
const onTwoFactorAuthCodeNotificationForDiscord = function(r){

View File

@ -149,6 +149,13 @@ module.exports = function(s,config,lang,getSnapshot){
}
})
}
await getSnapshot(d,monitorConfig)
sendMail([
{
filename: d.screenshotName + '.jpg',
content: d.screenshotBuffer
}
])
if(monitorConfig.details.detector_mail_send_video === '1'){
let videoPath = null
let videoName = null
@ -188,13 +195,6 @@ module.exports = function(s,config,lang,getSnapshot){
})
}
}
await getSnapshot(d,monitorConfig)
sendMail([
{
filename: d.screenshotName + '.jpg',
content: d.screenshotBuffer
}
])
})
}
}

View File

@ -150,6 +150,13 @@ module.exports = function (s, config, lang, getSnapshot) {
}),
},files || [],d.ke)
}
await getSnapshot(d,monitorConfig)
sendMail([
{
filename: d.screenshotName + '.jpg',
content: d.screenshotBuffer
}
])
if(monitorConfig.details.detector_mail_send_video === '1'){
let videoPath = null
let videoName = null
@ -178,13 +185,6 @@ module.exports = function (s, config, lang, getSnapshot) {
})
}
}
await getSnapshot(d,monitorConfig)
sendMail([
{
filename: d.screenshotName + '.jpg',
content: d.screenshotBuffer
}
])
}
};

View File

@ -68,6 +68,19 @@ module.exports = function(s,config,lang,getSnapshot){
clearTimeout(s.group[d.ke].activeMonitors[d.id].detector_telegrambot);
s.group[d.ke].activeMonitors[d.id].detector_telegrambot = null
},detector_telegrambot_timeout)
await getSnapshot(d,monitorConfig)
if(d.screenshotBuffer){
sendMessage({
title: lang.Event+' - '+d.screenshotName,
description: lang.EventText1+' '+d.currentTimestamp,
},[
{
type: 'photo',
attachment: d.screenshotBuffer,
name: d.screenshotName+'.jpg'
}
],d.ke)
}
if(monitorConfig.details.detector_telegrambot_send_video === '1'){
// await asyncSetTimeout(3000)
let videoPath = null
@ -96,19 +109,6 @@ module.exports = function(s,config,lang,getSnapshot){
],d.ke)
}
}
await getSnapshot(d,monitorConfig)
if(d.screenshotBuffer){
sendMessage({
title: lang.Event+' - '+d.screenshotName,
description: lang.EventText1+' '+d.currentTimestamp,
},[
{
type: 'photo',
attachment: d.screenshotBuffer,
name: d.screenshotName+'.jpg'
}
],d.ke)
}
}
}
const onTwoFactorAuthCodeNotificationForTelegram = function(r){