mirror of
https://github.com/LBRYFoundation/lbry-tipbot.git
synced 2025-08-23 16:57:24 +00:00
Statbot fixes
This commit is contained in:
parent
529b0181c6
commit
b587037da6
1 changed files with 9 additions and 7 deletions
|
@ -9,10 +9,10 @@ var options = {
|
||||||
// supported currencies and api steps to arrive at the final value
|
// supported currencies and api steps to arrive at the final value
|
||||||
currencies: {
|
currencies: {
|
||||||
USD: { steps: ['LBCBTC', 'BTCUSD'], format: '$0,0.00', sign:'$' },
|
USD: { steps: ['LBCBTC', 'BTCUSD'], format: '$0,0.00', sign:'$' },
|
||||||
BTC: { steps: ['LBCBTC',], format: 'BTC 0,0.00000000', sign:'BTC' },
|
BTC: { steps: ['LBCBTC'], format: 'BTC 0,0.00000000', sign:'BTC' },
|
||||||
ETH: { steps: ['LBCETH',], format: 'ETH 0,0.00000000', sign: 'ETH' },
|
ETH: { steps: ['LBCETH'], format: 'ETH 0,0.00000000', sign: 'ETH' },
|
||||||
GBP: { steps: ['LBCBTC', 'BTCGBP'], format: '£0,0.00', sign: '£' },
|
GBP: { steps: ['LBCBTC', 'BTCGBP'], format: '£0,0.00', sign: '£' },
|
||||||
EUR: { steps: ['LBCBTC', 'BTCGBP'], format: '€0,0.00', sign: '€' }
|
EUR: { steps: ['LBCEUR'], format: '€0,0.00', sign: '€' }
|
||||||
},
|
},
|
||||||
|
|
||||||
// api steps
|
// api steps
|
||||||
|
@ -84,8 +84,10 @@ function respond(bot, data) {
|
||||||
doHelp(bot, channel);
|
doHelp(bot, channel);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
doSteps(bot, channel, 'ETH', amount);
|
|
||||||
doSteps(bot, channel, 'USD', amount);
|
doSteps(bot, channel, 'USD', amount);
|
||||||
|
doSteps(bot, channel, 'EUR', amount);
|
||||||
|
doSteps(bot, channel, 'GBP', amount);
|
||||||
|
doSteps(bot, channel, 'ETH', amount);
|
||||||
doSteps(bot, channel, 'BTC', amount);
|
doSteps(bot, channel, 'BTC', amount);
|
||||||
setTimeout(function() { marketstats(bot,channel); }, 250);
|
setTimeout(function() { marketstats(bot,channel); }, 250);
|
||||||
//marketstats(bot,channel);
|
//marketstats(bot,channel);
|
||||||
|
@ -114,12 +116,12 @@ function doHelp(bot, channel) {
|
||||||
|
|
||||||
function formatMessage(amount, rate, option) {
|
function formatMessage(amount, rate, option) {
|
||||||
var cur = option.sign;
|
var cur = option.sign;
|
||||||
var value = numeral(rate.rate * amount).format('0,0[.][00000000]');
|
var value = rate.rate * amount;
|
||||||
if (option.sign == '$' || option.sign == '£' || option.sign == '€'){
|
if (option.sign == '$' || option.sign == '£' || option.sign == '€'){
|
||||||
return '*' + numeral(amount).format('0,0[.][00000000]') + ' LBC = ' + cur +' '+ value + '*';
|
return '*' + numeral(amount).format('0,0[.][00000000]') + ' LBC = ' + cur +' '+ value.toFixed(2) + '*';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return '*' + numeral(amount).format('0,0[.][00000000]') + ' LBC = ' + value + ' ' + cur + '*';
|
return '*' + numeral(amount).format('0,0[.][00000000]') + ' LBC = ' + numeral(value).format('0,0[.][00000000]') + ' ' + cur + '*';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue