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

212
Views
DiscordAPIError: Cannot send an empty message (Canva)

I been trying to get this canva to work for like an hour but it keeps throwing this error

DiscordAPIError: Cannot send an empty message

My code

client.on('guildMemberAdd', async member => {
  const { Welcomer } = require("canvacord");

  const card = new Welcomer()
  .setUsername(member.user.username)
  .setDiscriminator(member.user.discriminator)
  .setMemberCount(member.guild.memberCount.toLocaleString())
  .setGuildName(member.guild.name)
  .setAvatar(member.user.displayAvatarURL({ format: "png" }))
  .setColor("border", "#eb26dd")
  .setColor("username-box", "#eb26dd")
  .setColor("discriminator-box", "#eb26dd")
  .setColor("message-box", "#eb26dd")
  .setColor("title", "#eb26dd")
  .setColor("avatar", "#eb26dd")
  .setText("member-count", "- {count} members")
  .setText("title", "welcome")
  .setText("message", "welcome to MD")


  card.build()
      .then(buffer => client.channels.cache.get("942901196119760896").send(new MessageAttachment(buffer, "welcome.png")));
});
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

When sending attachments in discord.js v13, you need to specify that you are sending a MessageAttachment by using the file property when sending the attachment. It might look like this:

card.build()
        .then(buffer => {
            const attachment = new MessageAttachment(buffer, 'welcome.png');
            client.channels.cache.get("channel-id").send({ files: [attachment]})
        });
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!