f0ckv1/src/trigger/stats.js
2016-09-15 00:05:18 +02:00

20 lines
507 B
JavaScript

var du = require('du');
module.exports = (lib) => {
lib.trigger.add({
name: 'stats',
call: /^\!stats$/i,
level: 10,
active: 1,
func: (e) => {
lib.sql.query("select count(`id`) as anzahl from `f0ck`.`items`", (err, rows, fields) => {
var ret = "f0cked "+String(rows[0].anzahl);
du('./b/', function (err, size) {
ret += " f0cks ("+lib.formatSize(size)+")";
e.reply(ret);
})
});
},
desc: 'stats'
});
};