mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-24 22:34:46 +02:00
Fix Everything
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user