2022-10-05 11:30:49 +02:00
|
|
|
const NotificationProvider = require("./notification-provider");
|
|
|
|
const axios = require("axios");
|
|
|
|
|
|
|
|
class FreeMobile extends NotificationProvider {
|
|
|
|
name = "FreeMobile";
|
|
|
|
|
2023-08-11 09:46:41 +02:00
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
2022-10-05 11:30:49 +02:00
|
|
|
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
|
2024-03-14 14:21:15 +01:00
|
|
|
const okMsg = "Sent Successfully.";
|
|
|
|
|
2022-10-05 11:30:49 +02:00
|
|
|
try {
|
|
|
|
await axios.post(`https://smsapi.free-mobile.fr/sendmsg?msg=${encodeURIComponent(msg.replace("🔴", "⛔️"))}`, {
|
|
|
|
"user": notification.freemobileUser,
|
|
|
|
"pass": notification.freemobilePass,
|
|
|
|
});
|
|
|
|
|
|
|
|
return okMsg;
|
|
|
|
|
|
|
|
} catch (error) {
|
|
|
|
this.throwGeneralAxiosError(error);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = FreeMobile;
|