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

239
Views
si tiene footer.text reacciona, pero quiero que haga lo contrario

lo que hace es agregar una reacción :pray: cuando una inserción tiene footer.text , pero no quiero eso, quiero que reaccione cuando no tiene footer.text

 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] || !embed[i].footer || embed[i].footer.text === null) return; // check each embed if it has footer.text or not, if it doesnt then do nothing { setTimeout(function(){ message.react(':pray:') }, 1000); } } }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Simplemente necesita cambiar sus condiciones así:

 if (embed[i] || embed[i].footer || embed[i].footer.text !== null) { setTimeout(function() { message.react('🙏') }, 1000); }

Donde !== representa la Strict Inequality , por lo que lo que realmente está haciendo es verificar las siguientes condiciones

  • Si hay una inserción en el mensaje
  • Si ese objeto incrustado tiene un pie de página
  • Si el contenido del pie de página no está vacío

Además, dado que todas estas condiciones son necesarias, sugeriría usar el operador Logical AND (&&) que solo devuelve verdadero si se cumplen las comprobaciones de todos los operandos, por lo que su código se vería así:

 if (embed[i] && embed[i].footer && embed[i].footer.text !== null) { setTimeout(function() { message.react('🙏') }, 1000); }
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!