This commit is contained in:
Flummi 2017-05-05 07:54:37 +02:00
parent 9542f76ce7
commit afff24ea5d

19
src/trigger/uptime.js Normal file
View File

@ -0,0 +1,19 @@
var exec = require('child_process').exec;
module.exports = (lib) => {
lib.trigger.add({
name: 'uptime',
call: /^!uptime/i,
level: 0,
active: 1,
func: (e) => {
exec('sudo systemctl status f0ck', (error, stdout) => {
if(error === null) {
let uptime = stdout.split('\n')[2].trim().replace("Active: active (running)", "i'm active");
e.reply(uptime);
}
});
},
desc: 'Uptime'
});
};