-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy paththirsty.js
36 lines (35 loc) · 856 Bytes
/
thirsty.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
const schedule = require("node-schedule");
const notifier = require("node-notifier");
const isLinux = require("is-linux");
schedule.scheduleJob("0 */2 * * *", function() {
if (isLinux()) {
notifier.notify({
title: "DRINK WATER",
message: "Its time to Drink Water 🍹"
});
return;
}
const trueAnswer = "Yes !";
notifier.notify(
{
title: "DRINK WATER",
message: "Did you Drink 🍹 Water 🚰 ❓",
closeLabel: 'Absolutely not',
actions: trueAnswer
},
function(err, response, metadata) {
if (err) throw err;
if (metadata.activationValue === trueAnswer) {
notifier.notify({
title: "DRINK WATER",
message: "Then let's code, Champ 😉 !!"
});
} else {
notifier.notify({
title: "DRINK WATER",
message: "Please drink water now or you'll get dehydrated 🚑 "
});
}
}
);
});