Use the prefix !country along with any country to get info about it
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
const axios = require('axios');
const country = context.params.event.content.split(' ')[1];
const {data} = await axios(`https://apiv1.spapi.ga/fun/countryinfo?name=${country}`);
console.log(data);
await lib.discord.channels['@0.3.2'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: '',
tts: false,
embeds: [
{
type: 'rich',
title: `${data.name} | ${data.alt[0]}`,
description: `
\`•\` Currencies: **${data.currencies}**
\`•\` Call Code: **${data.callCode.join(', ')}**
\`•\` Languages: **${data.langs.join(', ')}**
\`•\` Capital: **${data.capital}**
\`•\` Region: **${data.region}**
\`•\` Sub-Region: **${data.subregion}**
\`•\` TimeZones: **${data.timezones.join(', ')}**
\`•\` TLD: **${data.tld.join(', ')}**
\`•\` Native: **${data.native}**
\`•\` Longitude: **${data.longitude}**
\`•\` Area: **${data.area}**
\`•\` ISO: **${data.ISO.alpha2} | ${data.ISO.alpha3}**
\`•\` Borders: **${data.borders.join(', ')}**
\`•\` Provinces: **${data.provinces.join(', ')}**`,
color: 0xe100ff,
thumbnail: {
url: `${data.flag}`,
height: 0,
width: 0,
},
footer: {
text: `Population: ${data.population}`,
icon_url: `${data.flag}`,
},
url: `${data.wiki}`,
},
], // required
message_reference: {
message_id: `${context.params.event.id}`,
},
});