Fix up request commands with fancy encodeURI

This commit is contained in:
Daniel Odendahl Jr
2017-03-23 00:41:55 +00:00
parent f5691328ba
commit c3801f90f6
4 changed files with 6 additions and 5 deletions
+2 -1
View File
@@ -22,8 +22,9 @@ module.exports = class DefineCommand extends commando.Command {
if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log("[Command] " + message.content);
let thingtoSearch = encodeURI(message.content.split(" ").slice(1).join(" "));
message.channel.send('Searching...');
const SEARCH_URL = `https://www.google.com/search?q=${encodeURI(message.content)}`;
const SEARCH_URL = 'https://www.google.com/search?q=' + thingtoSearch;
request
.get(SEARCH_URL)
.then(function (response) {