From ce3bfb87e9fa63b25f99137760ea89bff64afb3a Mon Sep 17 00:00:00 2001 From: ProfessorDey Date: Thu, 10 Oct 2019 22:05:22 +0100 Subject: [PATCH] Neaten up Definitions Just a little adjustment to cut out a few unnecessary lines where an inline ternary operator would do. --- bot/modules/stats.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/bot/modules/stats.js b/bot/modules/stats.js index e30e447..9f6b12a 100644 --- a/bot/modules/stats.js +++ b/bot/modules/stats.js @@ -23,14 +23,8 @@ exports.stats = { let volume24_btc = Number(data.total_volume); let dt = new Date(); let timestamp = dt.toUTCString(); - let hr_indicator = ':thumbsup:'; - let day_indicator = ':thumbsup:'; - if (percent_change_1h < 0) { - hr_indicator = ':thumbsdown:'; - } - if (percent_change_24h < 0) { - day_indicator = ':thumbsdown:'; - } + let hr_indicator = (percent_change_1h < 0) ? ':thumbsdown:' : ':thumbsup:'; + let day_indicator = (percent_change_24h < 0) ? ':thumbsdown:' : ':thumbsup:'; 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) {