// convert 15 EUR to TRXvar trx =CurrencyQuote.convert({ amount:15, from:"EUR", to:"TRX" })// from 0.1 BTC to INRvar inr =CurrencyQuote.convert({ amount:0.1, from:"BTC", to:"INR" })
Check last updated time
// update time in seconds// max time in normal 3600 secondsvar secsFiat =CurrencyQuote.fiat.getCachingTime();var secsCrypto =CurrencyQuote.crypto.getCachingTime();var oneHour =60*60;if(secsCrypto > oneHour){// it is very old data! Last updated a hour agoBot.sendMessage("Please try later")return}var oneDay = oneHour*24;if(secsFiat > oneDay){// it is very old data! Last updated a day agoBot.sendMessage("Please try later")return}// get EURvar eur_price =CurrencyQuote.fiat.EUR;var btc_price =CurrencyQuote.crypto.BTC;