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

196
Views
si el incrustado no tiene autor.nombre me arroja un error

si la inserción de lectura no tiene autor.nombre, deja de funcionar y envía un error

ERROR C:\Users\windows 10\Desktop\bot_keytritz\index.js:64 if(incrustar[i].autor.nombre.longitud >= 0) ^

TypeError: no se pueden leer las propiedades de nulo (leyendo 'nombre')

 CODE if(message.embeds.length >= 0) // Check if the Message has embed or not { let embed = message.embeds // console.log(embed) just a console.log for(let i = 0; i < embed.length; i++) // Loop it since in v13 you can send multiple embed in single message { if(embed[i].author.name === null) return; // check each embed if it has title or not, if it doesnt then do nothing { if(ListClaims.includes(embed[i].author.name.toLowerCase())) // check each embed if it includes word or not { message.react('🎉') } } } }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Entonces, ¿por qué no verificará si existe antes de acceder? Hay 2 formas de hacerlo.

  1. Moderno con operador de encadenamiento opcional
 if (embed[i]?.author?.name === null) return;

o uno viejo con

 if (!embed[i] || !embed[i].author || embed[i].author.name === null) return;
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!