mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-05 13:53:12 +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}`);
|
||||
const $ = cheerio.load(response.text);
|
||||
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?', ''));
|
||||
return searchMsg.edit(href.q);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user