Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

149
Vistas
Mi segundo "si" nunca funciona cuando se cumplen las condiciones

Cuando una embed tiene un footer de página o no, envía un mensaje a la consola.

Pero la segunda condición

if (!embed[i] || !embed[i].footer || embed[i].footer.text === null)

No funciona.

Pero si bajo a la condición,

if (embed[i] && embed[i].footer && embed[i].footer.text !== null)

y subo

if (!embed[i] || !embed[i].footer || embed[i].footer.text === null) ,

ahora

if (embed[i] && embed[i].footer && embed[i].footer.text !== null)

no responde.

El segundo if no funciona nunca

 const { Client, Intents } = require("discord.js-selfbot"); const client = new Client({ intents: [ Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.GUILD_MESSAGE_REACTIONS, ], }); let token = ""; client.on("ready", () => { console.log(`Logged in as ${client.user.tag}!`); }); client.on("message", (message) => { if (message.embeds.length >= 0) { // Check if the Message has embed or not let embed = message.embeds; for (let i = 0; i < embed.length; i++) { if (embed[i] && embed[i].footer && embed[i].footer.text !== null) return; // check each embed if it has footer or not { console.log("no have footer"); } if (!embed[i] || !embed[i].footer || embed[i].footer.text === null) return; // check each embed if it has footer or not { console.log("have footer"); } } } }); client.login(token);
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

pones 2 condiciones y si son verdaderas sales con devolución, pero seguro una de ellas será cierta así que

 { console.log("have footer"); }

nunca será llamado

about 4 years ago · Juan Pablo Isaza Denunciar

0

El código se ve mal. Tal vez intente actualizar a continuación:

 client.on("message", (message) => { if (message.embeds.length >= 0) { // Check if the Message has embed or not let embed = message.embeds; for (let i = 0; i < embed.length; i++) { // check each embed if it has footer or not if (embed[i] && embed[i].footer && embed[i].footer.text !== null) { console.log("no have footer"); return; } // check each embed if it has footer or not if (!embed[i] || !embed[i].footer || embed[i].footer.text === null) { console.log("have footer"); return; } } } });
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda