Resolved syntax issues.

This commit is contained in:
Ralph 2019-10-09 20:37:54 -04:00 committed by GitHub
parent 28e95245b0
commit 61ee16ce64
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,8 +8,7 @@ exports.stats = {
usage: '',
description: 'Displays list of current Market stats',
process: function(bot, msg) {
needle.get('https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc&ids=lbry-credits&order=market_cap_desc&per_page=100&page=1&sparkline=false&price_change_percentage=24h%2C1h%2C7d', function(error, response)
{
needle.get('https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc&ids=lbry-credits&order=market_cap_desc&per_page=100&page=1&sparkline=false&price_change_percentage=24h%2C1h%2C7d', function(error, response) {
if (error || response.statusCode !== 200) {
msg.channel.send('coingecko API is not available');
} else {
@ -33,43 +32,41 @@ exports.stats = {
day_indicator = ':thumbsdown:';
}
needle.get('https://api.coingecko.com/api/v3/coins/markets?vs_currency=gbp&ids=lbry-credits&order=market_cap_desc&per_page=100&page=1&sparkline=false', function(error, response) {
needle.get('https://api.coingecko.com/api/v3/coins/markets?vs_currency=gbp&ids=lbry-credits&order=market_cap_desc&per_page=100&page=1&sparkline=false', function (error, response) {
if (error || response.statusCode !== 200) {
msg.channel.send('coingecko API is not available');
} else {
data = response.body.data;
let price_gbp = Number(data.current_price);
needle.get('https://api.coingecko.com/api/v3/coins/markets?vs_currency=eur&ids=lbry-credits&order=market_cap_desc&per_page=100&page=1&sparkline=false', function(error, response) {
needle.get('https://api.coingecko.com/api/v3/coins/markets?vs_currency=eur&ids=lbry-credits&order=market_cap_desc&per_page=100&page=1&sparkline=false', function (error, response) {
if (error || response.statusCode !== 200) {
msg.channel.send('coingecko API is not available');
} else {
data = response.body.data;
let price_eur = Number(data.current_price);
needle.get('https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&ids=lbry-credits&order=market_cap_desc&per_page=100&page=1&sparkline=false', function(error, response) {
needle.get('https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&ids=lbry-credits&order=market_cap_desc&per_page=100&page=1&sparkline=false', function (error, response) {
if (error || response.statusCode !== 200) {
msg.channel.send('coingecko API is not available');
} else {
data = response.body.data;
let price_usd = Number(data.current_price);
let description = `**Rank: [${rank}](${statsurl})**
**Data**
Market Cap: [$${numberWithCommas(market_cap_usd)}](${statsurl})
Total Supply: [${numberWithCommas(total_supply)} LBC](${statsurl})
Circulating Supply: [${numberWithCommas(circulating_supply)} LBC](${statsurl})
24 Hour Volume: [$${volume24_usd}](${statsurl})
**Data**
Market Cap: [$${numberWithCommas(market_cap_usd)}](${statsurl})
Total Supply: [${numberWithCommas(total_supply)} LBC](${statsurl})
Circulating Supply: [${numberWithCommas(circulating_supply)} LBC](${statsurl})
24 Hour Volume: [$${volume24_usd}](${statsurl})
**Price**
BTC: [${price_btc.toFixed(8)}](${statsurl})
USD: [$${price_usd.toFixed(2)}](${statsurl})
EUR: [${price_eur.toFixed(2)}](${statsurl})
GBP: [£${price_gbp.toFixed(2)}](${statsurl})
**Price**
BTC: [${price_btc.toFixed(8)}](${statsurl})
USD: [$${price_usd.toFixed(2)}](${statsurl})
EUR: [${price_eur.toFixed(2)}](${statsurl})
GBP: [£${price_gbp.toFixed(2)}](${statsurl})
**% Change**
1 Hour: [${percent_change_1h}](${statsurl}) ${hr_indicator}
**% Change**
1 Hour: [${percent_change_1h}](${statsurl}) ${hr_indicator}
1 Day: [${percent_change_24h}](${statsurl}) ${day_indicator}
`;
1 Day: [${percent_change_24h}](${statsurl}) ${day_indicator}`;
const embed = {
description: description,
color: 7976557,
@ -82,7 +79,7 @@ GBP: [£${price_gbp.toFixed(2)}](${statsurl})
icon_url: 'https://spee.ch/2/pinkylbryheart.png'
}
};
msg.channel.send({ embed });
msg.channel.send({embed});
}
});
}
@ -110,4 +107,6 @@ GBP: [£${price_gbp.toFixed(2)}](${statsurl})
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
}
}
};
})
}
}