mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-26 22:32:52 +02:00
Fix No Results Error
This commit is contained in:
@@ -34,7 +34,7 @@ module.exports = class DefineCommand extends commando.Command {
|
|||||||
.get(`https://www.google.com/search?q=${thingToSearch}`);
|
.get(`https://www.google.com/search?q=${thingToSearch}`);
|
||||||
const $ = cheerio.load(response.text);
|
const $ = cheerio.load(response.text);
|
||||||
let href = $('.r').first().find('a').first().attr('href');
|
let href = $('.r').first().find('a').first().attr('href');
|
||||||
if (!href) return message.say(':x: Error! No Results Found!');
|
if (!href) return searchMsg.edit(':x: Error! No Results Found!');
|
||||||
href = querystring.parse(href.replace('/url?', ''));
|
href = querystring.parse(href.replace('/url?', ''));
|
||||||
return searchMsg.edit(href.q);
|
return searchMsg.edit(href.q);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user