Fix Everything

This commit is contained in:
Daniel Odendahl Jr
2017-06-01 18:31:20 +00:00
parent 66706d9c7b
commit 4e1f83a30f
85 changed files with 721 additions and 851 deletions
+2 -6
View File
@@ -25,14 +25,10 @@ module.exports = class GoogleCommand extends Command {
const message = await msg.say('Searching...');
const { text } = await snekfetch
.get('https://www.google.com/search')
.query({
q: query
});
.query({ q: query });
const $ = cheerio.load(text);
let href = $('.r').first().find('a').first().attr('href');
if (!href) {
return msg.say('No Results.');
}
if (!href) return msg.say('No Results.');
href = querystring.parse(href.replace('/url?', ''));
return message.edit(href.q);
}