Skip to content

Commit

Permalink
Fix btc
Browse files Browse the repository at this point in the history
  • Loading branch information
CrazyLemon committed Feb 25, 2017
1 parent 0fc9759 commit fa64b11
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions scripts/servisi.coffee
Expand Up @@ -172,12 +172,10 @@ module.exports = (bot) ->
bot.regexp /^\.btc (.+)/,
".btc <valuta> - izpiše trenutno BTC vrednost na Bitstamp",
(match, r) ->
currency = match[1]
if currency == "eur" || currency = "usd"
currency = match[1].toLowerCase()
if currency == "eur" || currency == "usd"
bot.fetchJSON "https://www.bitstamp.net/api/v2/ticker/btc#{currency}/", (data) ->
if data && ! null
r.reply "Vrednost BTC v #{currency.toUpperCase()}: last: #{data.last}, low: #{data.low}, high: #{data.high}, bid: #{data.bid}, ask: #{data.ask}"
r.reply "Vrednost BTC v #{currency.toUpperCase()}: last: #{data.last}, low: #{data.low}, high: #{data.high}, bid: #{data.bid}, ask: #{data.ask}"
else
r.reply "Bitstamp is down"
else
r.reply "Napačna valuta"

0 comments on commit fa64b11

Please sign in to comment.