Undo parm changes

This commit is contained in:
Domenic Horner
2021-09-04 20:08:18 +08:00
parent b0acda52f9
commit 41d32bb9dd
3 changed files with 12 additions and 15 deletions

View File

@@ -17,21 +17,9 @@ class Notification {
* @returns {Promise<string>} Successful msg
* Throw Error with fail msg
*/
static async send(notification, monitorName = null, monitorJSON = null, heartbeatJSON = null) {
static async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
let okMsg = "Sent Successfully. ";
let msg = `[${notification.name}] Testing`;
// heartbeatJSON is only defined if we're not testing
if(heartbeatJSON) {
let text;
if (heartbeatJSON["status"] === UP) {
text = "✅ Up"
} else {
text = "🔴 Down"
}
msg = `[${monitorName}] [${text}] ${heartbeatJSON["msg"]}`;
}
if (notification.type === "telegram") {
try {
await axios.get(`https://api.telegram.org/bot${notification.telegramBotToken}/sendMessage`, {