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

306
Views
.TypeError: no se puede leer la propiedad 'contenido' de undefined

esto es realmente confuso para mi

aquí está el error

 TypeError: Cannot read property 'content' of undefined

Y aquí está el código

 client.on("messageDelete", async (member, message) => { let aud = db.get(`auditchannel_${member.guild.id}`); if(aud === null) { return; } client.channels.cache.get(aud).send(`<@${member.member.user.id}>'s message was deleted in <#${member.channel.id}>`) console.log(message.content()) })
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

messageDelete tiene solo un argumento, vea el ejemplo , por lo que la variable del mensaje no está definida y está tratando de leer el 'contenido' de "mensaje".

about 4 years ago · Juan Pablo Isaza Report

0

Indefinido significa que una variable ha sido declarada pero aún no se le ha asignado un valor. Este error en particular es probablemente más fácil de entender desde la perspectiva de undefined, ya que undefined no se considera un tipo de objeto en absoluto (sino su propio tipo indefinido), y las propiedades solo pueden pertenecer a objetos dentro de JavaScript.

En el código anterior, cuando obtiene un error indefinido, debe asegurarse de que a cualquier variable que arroje un error indefinido se le asigne un valor.

 function myFunc(inVar) { if (inVar === undefined) { console.log(inVar.not) } return inVar; } var testVar=99;//initialize here console.log(myFunc(testVar));

En el JavaScript anterior, puede que la variable testVar se inicialice con el valor de 99. Por lo tanto, el script se ejecuta correctamente.

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!