diff --git a/utils/convert.py b/utils/convert.py index 546b242..1193c65 100644 --- a/utils/convert.py +++ b/utils/convert.py @@ -25,7 +25,7 @@ class Converter: def convert(self) -> None: if not self.kekkai(): - self.kekkai() + self.ddg() number = Decimal(str(self.conv_amount)) @@ -62,7 +62,8 @@ class Converter: res = requests.get(f'{config['kekkai_instance']}/api/getRate/', { 'from_currency': self.from_currency, 'conv_currency': self.conv_currency, - 'date': date + 'date': date, + 'conv_amount': self.conv_amount }, timeout=3) data = res.json() @@ -70,7 +71,8 @@ class Converter: if not HTTPStatus(res.status_code).is_success: return False - self.conv_amount = float(data.get('rate') * self.amount) + + self.conv_amount = data.get('conv_amount') return True except requests.exceptions.ConnectionError: