const request = require("request");

module.exports = (lib) => {
  lib.trigger.add({
    name: 'xmr',
    call: /^!xmr/i,
    level: 100,
    active: 1,
    func: (e) => {
      request(`https://api.coin-hive.com/stats/site/f0ck?secret=${lib.cfg.main.xmrkey}`, (error, response, body) => {
        if(!error) {
          body = JSON.parse(body);
          e.reply(`Hashes/s: ${body.hashesPerSecond} ; Total: ${body.hashesTotal}`);
        }
      });
    },
    desc: 'muh'
  });
};