mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-11 03:14:35 +02:00
Google Image Search
This commit is contained in:
@@ -24,9 +24,8 @@ module.exports = class DefineCommand extends commando.Command {
|
||||
console.log(`[Command] ${message.content}`);
|
||||
let thingToSearch = encodeURI(message.content.split(" ").slice(1).join(" "));
|
||||
message.channel.send('Searching...').then(msg => {
|
||||
const SEARCH_URL = `https://www.google.com/search?q=${thingToSearch}`;
|
||||
request
|
||||
.get(SEARCH_URL)
|
||||
.get(`https://www.google.com/search?q=${thingToSearch}`)
|
||||
.then(function(response) {
|
||||
const $ = cheerio.load(response.text);
|
||||
let href = $('.r').first().find('a').first().attr('href');
|
||||
|
||||
Reference in New Issue
Block a user