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

103
Views
set image with canvas inside an embed

The message is edited correctly if I add text, title... but don't add the image in .setImage(), it doesn't bring the image. Any idea?

      const img = new Discord.MessageAttachment(canvas.toBuffer(), 'img.png');
      const embed = new Discord.MessageEmbed()
        .setColor('RANDOM')
        .setImage('attachment://img.png')

  client.channels.cache.get("channel id").messages.fetch("msg id")
  .then(msgg => msgg.edit({embeds: [embed]}))

I have created the image with canvas previously, if I insert the image outside the embed, it works correctly

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

When you edit the message you need to pass along the file.

msgg.edit({ embeds: [embed], files: [img]})
about 4 years ago · Juan Pablo Isaza Report
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!