mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +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}.`);
|
||||
try {
|
||||
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 converted = rate * amount;
|
||||
return msg.say(`${amount} ${base} is ${converted} ${to}.`);
|
||||
|
||||
Reference in New Issue
Block a user