mirror of
https://github.com/LBRYFoundation/lbry-wunderbot.git
synced 2025-09-17 07:49:45 +00:00
commit
4043fdb962
1 changed files with 26 additions and 26 deletions
|
@ -19,18 +19,18 @@ exports.timedhash = function(bot) {
|
||||||
if (error || response.statusCode !== 200) {
|
if (error || response.statusCode !== 200) {
|
||||||
msg.channel.send('Explorer API is not available');
|
msg.channel.send('Explorer API is not available');
|
||||||
} else {
|
} else {
|
||||||
var data = response.body;
|
let data = response.body;
|
||||||
var height = Number(data.status.height);
|
let height = Number(data.status.height);
|
||||||
var hashrate = data.status.hashrate;
|
let hashrate = data.status.hashrate;
|
||||||
var difficulty = Number(data.status.difficulty);
|
let difficulty = Number(data.status.difficulty);
|
||||||
needle.get('https://whattomine.com/coins/164.json', function(error, response) {
|
needle.get('https://whattomine.com/coins/164.json', function(error, response) {
|
||||||
if (error || response.statusCode !== 200) {
|
if (error || response.statusCode !== 200) {
|
||||||
msg.channel.send('whattomine API is not available');
|
msg.channel.send('whattomine API is not available');
|
||||||
}
|
}
|
||||||
var data = response.body;
|
let data = response.body;
|
||||||
var reward = Number(data.block_reward);
|
let reward = Number(data.block_reward);
|
||||||
var block_time = Number(data.block_time);
|
let block_time = Number(data.block_time);
|
||||||
var difficulty24 = Number(data.difficulty24);
|
let difficulty24 = Number(data.difficulty24);
|
||||||
description =
|
description =
|
||||||
'Hashrate: ' +
|
'Hashrate: ' +
|
||||||
numberWithCommas(hashrate) +
|
numberWithCommas(hashrate) +
|
||||||
|
@ -75,7 +75,7 @@ exports.hash = {
|
||||||
usage: '',
|
usage: '',
|
||||||
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) {
|
||||||
var command = '!hash';
|
let command = '!hash';
|
||||||
words = suffix
|
words = suffix
|
||||||
.trim()
|
.trim()
|
||||||
.split(' ')
|
.split(' ')
|
||||||
|
@ -101,18 +101,18 @@ exports.hash = {
|
||||||
if (error || response.statusCode !== 200) {
|
if (error || response.statusCode !== 200) {
|
||||||
msg.channel.send('Explorer API is not available');
|
msg.channel.send('Explorer API is not available');
|
||||||
} else {
|
} else {
|
||||||
var data = response.body;
|
let data = response.body;
|
||||||
var height = Number(data.status.height);
|
let height = Number(data.status.height);
|
||||||
var hashrate = data.status.hashrate;
|
let hashrate = data.status.hashrate;
|
||||||
var difficulty = Number(data.status.difficulty);
|
let difficulty = Number(data.status.difficulty);
|
||||||
needle.get('https://whattomine.com/coins/164.json', function(error, response) {
|
needle.get('https://whattomine.com/coins/164.json', function(error, response) {
|
||||||
if (error || response.statusCode !== 200) {
|
if (error || response.statusCode !== 200) {
|
||||||
msg.channel.send('whattomine API is not available');
|
msg.channel.send('whattomine API is not available');
|
||||||
}
|
}
|
||||||
var data = response.body;
|
let data = response.body;
|
||||||
var reward = Number(data.block_reward);
|
let reward = Number(data.block_reward);
|
||||||
var block_time = Number(data.block_time);
|
let block_time = Number(data.block_time);
|
||||||
var difficulty24 = Number(data.difficulty24);
|
let difficulty24 = Number(data.difficulty24);
|
||||||
description =
|
description =
|
||||||
'Hashrate: ' +
|
'Hashrate: ' +
|
||||||
numberWithCommas(hashrate) +
|
numberWithCommas(hashrate) +
|
||||||
|
@ -159,18 +159,18 @@ exports.hash = {
|
||||||
.filter(function(n) {
|
.filter(function(n) {
|
||||||
return n !== '';
|
return n !== '';
|
||||||
});
|
});
|
||||||
var myhashrate = words[1];
|
let myhashrate = words[1];
|
||||||
if (myhashrate == '' || myhashrate == null || myhashrate == undefined || myhashrate == ' ') {
|
if (myhashrate == '' || myhashrate == null || myhashrate == undefined || myhashrate == ' ') {
|
||||||
myhashrate = '100';
|
myhashrate = '100';
|
||||||
}
|
}
|
||||||
var Diff = response.body.difficulty24;
|
let Diff = response.body.difficulty24;
|
||||||
var Reward = response.body.block_reward;
|
let Reward = response.body.block_reward;
|
||||||
var myHash = Number(myhashrate);
|
let myHash = Number(myhashrate);
|
||||||
var LBC = myHash / 2000 * (1 / ((Diff * 2) ^ 32) * Reward) * 3600;
|
let LBC = myHash / 2000 * (1 / ((Diff * 2) ^ 32) * Reward) * 3600;
|
||||||
var LBC24 = myHash / 2000 * (1 / ((Diff * 2) ^ 32) * Reward) * 86400;
|
let LBC24 = myHash / 2000 * (1 / ((Diff * 2) ^ 32) * Reward) * 86400;
|
||||||
var LBC1w = myHash / 2000 * (1 / ((Diff * 2) ^ 32) * Reward) * 604800;
|
let LBC1w = myHash / 2000 * (1 / ((Diff * 2) ^ 32) * Reward) * 604800;
|
||||||
var LBC1m = myHash / 2000 * (1 / ((Diff * 2) ^ 32) * Reward) * 2628000;
|
let LBC1m = myHash / 2000 * (1 / ((Diff * 2) ^ 32) * Reward) * 2628000;
|
||||||
var message =
|
let message =
|
||||||
'With **' +
|
'With **' +
|
||||||
myHash +
|
myHash +
|
||||||
' Mh/s** and Average 24 hour Difficulty: **' +
|
' Mh/s** and Average 24 hour Difficulty: **' +
|
||||||
|
|
Loading…
Add table
Reference in a new issue