Skip to content

Commit

Permalink
Merge pull request #46 from Ayrox/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Ayrox authored Oct 26, 2021
2 parents 5331264 + 9fa18f1 commit 1923310
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
const { MessageEmbed, MessageAttachment } = require('discord.js')
const Scrapper = require('images-scraper')

const google = new Scrapper({
puppeteer: {
headless: true,
args: ["--no-sandbox"]
}
})

module.exports = {

Expand All @@ -32,7 +26,33 @@ module.exports = {

await message.editReply({embeds : [{description : "⏳ En attente de Google Image ... ", color:0xFF6800}]})
.then(async (resultMessage) => {
const img_result = await google.scrape("chauve barbue", 200) //changer en chauve barbue

let img_result;

try {
const google = new Scrapper({
puppeteer: {
headless: true,
executablePath: '/usr/bin/chromium-browser',
}
})

img_result = await google.scrape("chauve barbue", 200) //changer en chauve barbue


} catch (e) {


const google = new Scrapper({
puppeteer: {
headless: true,
}
})

img_result = await google.scrape("chauve barbue", 200) //changer en chauve barbue
}



let baldEmbed = new MessageEmbed()
.setColor(0xEDB987)
Expand All @@ -43,6 +63,7 @@ module.exports = {
resultMessage.edit({
embeds: [baldEmbed],
})

});


Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 1923310

Please sign in to comment.