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

244
Views
I'm getting the error DiscordAPIError: Cannot send an empty message. in one of my commands it was completely fine yesterday, I didn't change anything

this code is for join-leave-logs in my servers, the code was completely fine yesterday and I didnt change a single thing in it and now im getting an error message whenever someone leaves or joins the server.

client.on('guildMemberAdd', async(member) => { 
  const Channel = member.guild.channels.cache.get('922828509515239426')
  const Channel_chillhub = member.guild.channels.cache.get('876212928041332776')
  const embed = new Discord.MessageEmbed()
      .setColor('AQUA')
      .setAuthor('Member joined', member.displayAvatarURL())
      .setDescription(`**${member.displayName}** Joined ${member.guild.name}`)
      try{
        Channel_chillhub.send({ embeds: [embed] })
      } catch (e){
        Channel.send({ embeds: [embed] })
      }
})
client.on('guildMemberRemove', async(member) => {
  const Channel = member.guild.channels.cache.get('922828509515239426')
  const Channel_chillhub = member.guild.channels.cache.get('876212928041332776')
  const embed = new Discord.MessageEmbed()
      .setColor('RED')
      .setTitle('Member left the server')
      .setDescription(`**${member.displayName}** has left ${member.guild.name}`)
      try{
        Channel_chillhub.send({ embeds: [embed] })
      } catch (e){
        Channel.send({ embeds: [embed] })
      }
})

here's the error message when someone leaves a server: DiscordAPIError: Cannot send an empty message

and here's the error message when someone joins it: TypeError: member.displayAvatarURL is not a function

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

0

For the error: TypeError: member.displayAvatarURL is not a function, try using member.user.avatarURL() instead of member.displayAvatarURL().

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!