Merge branch 'f0ckdev' into 'master'

uptime

See merge request !106
This commit is contained in:
Flummi 2017-05-05 05:55:58 +00:00
commit b0d86bb53c

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'
});
};