Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

223
Views
puppeteer screenshot and send it with a discord command

I'm trying to make a discord bot that takes a screenshot of a specific website(here I'm just using google for example) and send it through discord by command. for some reason it's not working and I'm not sure what I'm doing wrong here. I'm also fairly new to node.js and discord.js. I have created a seperate file for all commands and here is the one with puppeteer:

const pupp = require('puppeteer');

module.exports = {
    name: 'pup',
    description:'send image',
    execute(client, message, args, Discord){
        (async () => {
            const browser = await pupp.launch();
            const page = await browser.newPage();
            await page.goto('https://www.google.com');
            let screenshot = await page.screenshot({ path: 'screenshot.png' });
            await browser.close();

        message.channel.send("screenshot",{files: [screenshot]});
      })();
}
}

and here is my main.js code:

 const Discord = require('discord.js');
const token = 'TOKEN';

const client = new Discord.Client({ intents: ["GUILDS", "GUILD_MESSAGES"] });

client.commands = new Discord.Collection();
client.events = new Discord.Collection();

['commands_handler','events_handler'].forEach(handler =>{
    require(`./handlers/${handler}`)(client, Discord);
})
client.login(token);
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!