From 84f9f190112668be259b8b3664271579c2d2570f Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Thu, 23 Mar 2017 00:42:19 +0000 Subject: [PATCH] Wikipedia Too --- commands/search/wikipedia.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/search/wikipedia.js b/commands/search/wikipedia.js index 120824ab..6b7fd8f8 100644 --- a/commands/search/wikipedia.js +++ b/commands/search/wikipedia.js @@ -18,7 +18,7 @@ module.exports = class WikipediaCommand extends commando.Command { if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; } console.log("[Command] " + message.content); - let thingToSearch = message.content.split(" ").slice(1).join("%20"); + let thingToSearch = encodeURI(message.content.split(" ").slice(1).join(" ")); request .get("https://en.wikipedia.org/w/api.php?action=query&prop=extracts&format=json&titles=" + thingToSearch + "&exintro=&explaintext=&redirects=&formatversion=2") .then(function (response) {