import axios from 'axios' ; import type { ICurrency } from '../interfaces/Currency' ; import type { Message } from 'whatsapp-web.js' ; export const EconomyCommand = { async execute ( msg ) { const chat = await msg . getChat ( ) ; await chat . sendStateTyping ( ) ; const { data } = await axios . get ( 'https://economia.awesomeapi.com.br/all/USD-BRL,BTC-BRL,EUR-BRL' ) ; const type = ( currency ) => { return `\n💲 *${ currency . name } (${ currency . code })* \nValor atual: R$ ${ currency . bid } \nValor mais alto: R$ ${ currency . high } \nValor mais baixo: R$ ${ currency . low }\n` ; } ; return msg . reply ( `Cotação atual: 💎💰🤑💹 \n${ type ( data . USD ) } ${ type ( data . EUR ) } ${ type ( data . BTC ) }` ) ; } , } ;