feat(notification): add pushover (#55)

Co-authored-by: Jef LeCompte <jeffreylec@gmail.com>
This commit is contained in:
Thomas Herrell
2020-09-19 14:55:21 -05:00
committed by GitHub
parent 8aba7ecbdb
commit c85658bf82
7 changed files with 40 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
import {Config} from '../config';
import {Logger} from '../logger';
import Push = require('pushover-notifications');
const p = new Push({
user: Config.notifications.pushover.user,
token: Config.notifications.pushover.token
});
export default function sendPushoverNotification(text: string) {
const message = {
message: text
};
p.send(message, (err: Error, result: string) => {
if (err) {
Logger.error(err);
} else {
Logger.info(`✔ Pushover notification sent: ${result}`);
}
});
}