Permalink
Browse files

Fix btc

  • Loading branch information...
1 parent 0fc9759 commit fa64b114f58644fb2c2402559b3f8e4533dd92d2 @CrazyLemon CrazyLemon committed Feb 25, 2017
Showing with 3 additions and 5 deletions.
  1. +3 −5 scripts/servisi.coffee
View
@@ -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.