Bug Fixes

This commit is contained in:
Daniel Odendahl Jr
2017-03-30 21:05:26 +00:00
parent 34cbf278df
commit eff2025533
4 changed files with 11 additions and 31 deletions
+1 -1
View File
@@ -34,7 +34,7 @@ module.exports = class DefineCommand extends commando.Command {
.get(`https://www.google.com/search?q=${thingToSearch}`);
const $ = cheerio.load(response.text);
let href = $('.r').first().find('a').first().attr('href');
if (!href) return Promise.reject(new Error('NO RESULTS'));
if (!href) return message.say(':x: Error! No Results Found!');
href = querystring.parse(href.replace('/url?', ''));
return searchMsg.edit(href.q);
}