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('🎉') } } } }Entonces, ¿por qué no verificará si existe antes de acceder? Hay 2 formas de hacerlo.
if (embed[i]?.author?.name === null) return;o uno viejo con
if (!embed[i] || !embed[i].author || embed[i].author.name === null) return;