From 9bedfcd03a1528c12cf171ea7bf77aadddc3b280 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sun, 17 Jan 2021 23:32:59 -0500 Subject: [PATCH] Fix --- commands/search/country.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/commands/search/country.js b/commands/search/country.js index fef203b4..79234293 100644 --- a/commands/search/country.js +++ b/commands/search/country.js @@ -22,8 +22,7 @@ module.exports = class CountryCommand extends Command { { key: 'query', prompt: 'What country would you like to search for?', - type: 'string', - parse: query => encodeURIComponent(query) + type: 'string' } ] }); @@ -31,7 +30,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 { body } = await request.get(`https://restcountries.eu/rest/v2/name/${encodeURIComponent(query)}`); const data = body.find(country => { return country.name.toLowerCase() === query.toLowerCase() || country.altSpellings.some(alt => alt.toLowerCase() === query.toLowerCase())