mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-26 19:36:29 +03:00
937c8a9a7b
Co-authored-by: Frank Elsinga <frank@elsinga.de>
23 lines
645 B
JavaScript
23 lines
645 B
JavaScript
const NotificationProvider = require("./notification-provider");
|
|
const axios = require("axios");
|
|
|
|
class CallMeBot extends NotificationProvider {
|
|
name = "CallMeBot";
|
|
|
|
/**
|
|
* @inheritdoc
|
|
*/
|
|
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
|
|
const okMsg = "Sent Successfully.";
|
|
try {
|
|
const url = new URL(notification.callMeBotEndpoint);
|
|
url.searchParams.set("text", msg);
|
|
await axios.get(url.toString());
|
|
return okMsg;
|
|
} catch (error) {
|
|
this.throwGeneralAxiosError(error);
|
|
}
|
|
}
|
|
}
|
|
|
|
module.exports = CallMeBot;
|