Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

226
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda