From 20d52f40c45ef618dd0303b46b7e008535a6cda7 Mon Sep 17 00:00:00 2001 From: iou1name Date: Thu, 22 Apr 2021 12:54:05 -0400 Subject: [PATCH] update currency api --- modules/currency.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/currency.py b/modules/currency.py index 6a9ece4..75ea0d7 100755 --- a/modules/currency.py +++ b/modules/currency.py @@ -8,7 +8,7 @@ import requests import config from module import commands, example -CUR_URI = "https://v3.exchangerate-api.com/bulk/{API_KEY}/{CUR_FROM}" +CUR_URI = "https://v6.exchangerate-api.com/v6/{API_KEY}/latest/{CUR_FROM}" BTC_URI = "https://api.coindesk.com/v1/bpi/currentprice/{CUR_TO}.json" @commands('cur', 'currency', 'exchange') @@ -40,7 +40,7 @@ def exchange(bot, trigger): if data["result"] == "error": return bot.msg("Error: " + data["error"]) - rate = data["rates"].get(cur_to) + rate = data["conversion_rates"].get(cur_to) if not rate: return bot.msg("Invalid output currency. Must be ISO 4217 compliant.")