Merge pull request #184 from ykris45/patch-6

fix bugs on !hash
This commit is contained in:
filipnyquist 2018-06-08 17:21:05 +02:00 committed by GitHub
commit 4fc923af52
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,7 +31,7 @@ exports.timedhash = function(bot) {
let reward = Number(data.block_reward); let reward = Number(data.block_reward);
let block_time = Number(data.block_time); let block_time = Number(data.block_time);
let difficulty24 = Number(data.difficulty24); let difficulty24 = Number(data.difficulty24);
description = let description =
'Hashrate: ' + 'Hashrate: ' +
numberWithCommas(hashrate) + numberWithCommas(hashrate) +
'\n' + '\n' +
@ -76,14 +76,14 @@ exports.hash = {
description: 'Displays current Hashrate of Network\n**!hash power <Mh/s>**\n Displays potential Earnings For Given Hashrate', description: 'Displays current Hashrate of Network\n**!hash power <Mh/s>**\n Displays potential Earnings For Given Hashrate',
process: function(bot, msg, suffix) { process: function(bot, msg, suffix) {
let command = '!hash'; let command = '!hash';
words = suffix let words = suffix
.trim() .trim()
.split(' ') .split(' ')
.filter(function(n) { .filter(function(n) {
return n !== ''; return n !== '';
}); });
profitcommand = words[0]; let profitcommand = words[0];
myhashrate = words[1]; let myhashrate = words[1];
if (profitcommand == 'power') { if (profitcommand == 'power') {
sendProfitInfo(bot, msg, suffix); sendProfitInfo(bot, msg, suffix);
return; return;
@ -113,7 +113,7 @@ exports.hash = {
let reward = Number(data.block_reward); let reward = Number(data.block_reward);
let block_time = Number(data.block_time); let block_time = Number(data.block_time);
let difficulty24 = Number(data.difficulty24); let difficulty24 = Number(data.difficulty24);
description = let description =
'Hashrate: ' + 'Hashrate: ' +
numberWithCommas(hashrate) + numberWithCommas(hashrate) +
'\n' + '\n' +