From b97c23677c21c25d2095a9ccf8c82a38eb4606d9 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Thu, 28 Sep 2017 18:30:15 +0000 Subject: [PATCH] Bug Fix --- commands/search/bulbapedia.js | 2 +- commands/search/wikipedia.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/search/bulbapedia.js b/commands/search/bulbapedia.js index c9fb13aa..c3f719fe 100644 --- a/commands/search/bulbapedia.js +++ b/commands/search/bulbapedia.js @@ -44,7 +44,7 @@ module.exports = class BulbapediaCommand extends Command { .setTitle(data.title) .setAuthor('Bulbapedia', 'https://i.imgur.com/ePpoeFA.png') .setThumbnail(data.thumbnail ? data.thumbnail.source : null) - .setURL(`https://bulbapedia.bulbagarden.net/wiki/${query.replace(/\)/gi, '%29')}`) + .setURL(`https://bulbapedia.bulbagarden.net/wiki/${encodeURIComponent(query.replace(/\)/gi, '%29'))}`) .setDescription(shorten(data.extract.replace(/\n/g, '\n\n'))); return msg.embed(embed); } catch (err) { diff --git a/commands/search/wikipedia.js b/commands/search/wikipedia.js index 71285880..3764f108 100644 --- a/commands/search/wikipedia.js +++ b/commands/search/wikipedia.js @@ -44,7 +44,7 @@ module.exports = class WikipediaCommand extends Command { .setTitle(data.title) .setAuthor('Wikipedia', 'https://i.imgur.com/Z7NJBK2.png') .setThumbnail(data.thumbnail ? data.thumbnail.source : null) - .setURL(`https://en.wikipedia.org/wiki/${query.replace(/\)/gi, '%29')}`) + .setURL(`https://en.wikipedia.org/wiki/${encodeURIComponent(query.replace(/\)/gi, '%29'))}`) .setDescription(shorten(data.extract.replace(/\n/g, '\n\n'))); return msg.embed(embed); } catch (err) {