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

235
Views
TypeError: Cannot read properties of undefined (reading 'send')

I am writing a discord bot with node.js. I want the bot to send a message automatically when a member joins or leaves the channel. But I keep getting an error about the send function. Can you help me? [1]: https://i.stack.imgur.com/4URud.png

module.exports = (client) => {
    client.on('guildMemberRemove', (member) => {
        console.log(member);
        
    member.guild.channels.cache.get("1234567890912345678").send("byeee");
  });
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

member.guild.channels.cache.get("1234567890912345678") is undefined, so there is no send() function. You need to identify why that channel is undefined or doesn't exist or find that channel using another method.

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!