0

I am having issues with running my bot with DigitalOverflow. It contains a command that takes a screenshots of websites and sends them in the channel. However, when I use the command with DigitalOverflow, I simply get this error, and I'm not sure how to fix it. There's nothing above that either and I've searched and searched with no avail.

        if(!message.channel.nsfw) return message.channel.send('This command is only usable in NSFW channels.')

    if(!args[0]) return message.channel.send("Please provide a URL!");
    let msg = args.join(" ")

    const browser = await puppeteer.launch({ args: ['--disable-setuid-sandbox', '--disable-gpu','--no-first-run','--no-sandbox',]});
    const page = await browser.newPage();

    message.channel.send("Please wait, this may take a while.").then(msg => msg.delete({timeout: 8000, reason: ""}))

    await page.goto(`${msg}`);

    await page.screenshot({path: 'example.png'});

    await browser.close();


  message.channel.send("`" + `${msg}` + "`", {files: ["./example.png"]}).catch((e) => message.channel.send(`Issue found: ${e}`))

Str8
  • 19
  • 2
  • 2
    When you have text output, [don't take a picture but copy paste the output in your POST](https://unix.meta.stackexchange.com/questions/4086/psa-please-dont-post-images-of-text) – Gilles Quénot Jun 10 '20 at 21:43
  • @GillesQuenot, I would but it's inside of the DigitalOcean cmd prompt and the error only appears inside of DigitalOcean. (No they don't let me copy the output.) – Str8 Jun 10 '20 at 22:13
  • Are you sure isn't DigitalOcean uses **some IP block,** like in this case: https://stackoverflow.com/questions/53091884/puppeteer-doesnt-work-at-vps-digitalocean ? It is a best practice to wrap promise dependent code in **try-catch** blocks, so if there is such error (e.g.: IP block on VPS) your app won't fail and you will have more specific error msg as well. – theDavidBarton Jun 11 '20 at 11:50

0 Answers0