mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-21 14:04:38 +02:00
Faster API Response
This commit is contained in:
@@ -47,7 +47,7 @@ module.exports = class CurrencyCommand extends Command {
|
|||||||
if(base === to) return msg.say(`${amount} ${base} is ${amount} ${base}.`);
|
if(base === to) return msg.say(`${amount} ${base} is ${amount} ${base}.`);
|
||||||
try {
|
try {
|
||||||
const { body } = await request
|
const { body } = await request
|
||||||
.get(`http://api.fixer.io/latest?base=${base}`);
|
.get(`http://api.fixer.io/latest?base=${base}&symbols=${to}`);
|
||||||
const rate = body.rates[to];
|
const rate = body.rates[to];
|
||||||
const converted = rate * amount;
|
const converted = rate * amount;
|
||||||
return msg.say(`${amount} ${base} is ${converted} ${to}.`);
|
return msg.say(`${amount} ${base} is ${converted} ${to}.`);
|
||||||
|
|||||||
Reference in New Issue
Block a user