var du = require('du');

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