This commit is contained in:
Daniel Odendahl Jr
2017-04-30 22:56:59 +00:00
parent 83e990ae1c
commit 877f720cfc
105 changed files with 460 additions and 461 deletions
+4 -4
View File
@@ -19,9 +19,9 @@ module.exports = class GoogleCommand extends Command {
});
}
async run(message, args) {
async run(msg, args) {
const { query } = args;
const msg = await message.say('Searching...');
const message = await msg.say('Searching...');
try {
const { text } = await request
.get(`https://www.google.com/search?q=${query}`);
@@ -29,9 +29,9 @@ module.exports = class GoogleCommand extends Command {
let href = $('.r').first().find('a').first().attr('href');
if (!href) throw new Error('No Results');
href = querystring.parse(href.replace('/url?', ''));
return msg.edit(href.q);
return message.edit(href.q);
} catch (err) {
return msg.edit('No Results Found.');
return message.edit('No Results Found.');
}
}
};