From 2ab5160fc1e66a8fad7b11c0437c2649f7ed5ffc Mon Sep 17 00:00:00 2001 From: root Date: Sat, 23 Sep 2017 03:23:26 +0000 Subject: [PATCH] indian rupees --- price.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/price.py b/price.py index c790ede..0db7ac5 100644 --- a/price.py +++ b/price.py @@ -749,6 +749,23 @@ def gbp(bot, trigger): except: bot.say("Failed to retrieve price.") +@sopel.module.commands('inr') +def inr(bot, trigger): + # Get conversion rate + try: + fixerresult = requests.get(fixerurl) + fixerjson = fixerresult.json() + usdthb = fixerjson['rates']['INR'] + except: + usdthb = 64 + try: + r=requests.get('https://api.coinmarketcap.com/v1/ticker/monero/') + j=r.json() + price=float(j[0]['price_usd'])*usdthb + bot.say("Monero price in INR = ₹{0:,.2f}".format(price)) + except: + bot.say("Failed to retrieve price.") + @sopel.module.commands('thb') def thb(bot, trigger): # Get conversion rate