mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-05 22:01:54 +02:00
Always use matching country name
This commit is contained in:
@@ -32,7 +32,7 @@ module.exports = class CountryCommand extends Command {
|
||||
async run(msg, { query }) {
|
||||
try {
|
||||
const { body } = await request.get(`https://restcountries.eu/rest/v2/name/${query}`);
|
||||
const data = body[0];
|
||||
const data = body.find(country => country.name.toLowerCase() === query.toLowerCase()) || body[0];
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0x00AE86)
|
||||
.setTitle(data.name)
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "126.6.3",
|
||||
"version": "126.6.4",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user