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

143
Vistas
member returns undefined for no apparent reason

For some reason whenever I try to run this code it only responds with the else Block instead of the wanted if (member) result

(Before I get comments saying: "Well clearly the User is not in the Guild." that's the Case here) lol

let member = msg.mentions.members.first() || msg.guild.members.cache.get(args[0]);
console.log(member);
if (member) {
    try {
        const userInfo = new MessageEmbed()
            .setAuthor({ name: `${member.user.tag}`, iconURL: member.user.displayAvatarURL({ dynamic: true }) })
            .setColor("BLUE")
            .setThumbnail(member.user.displayAvatarURL({ dynamic: true }))
            .setTitle("User Info")
            .setDescription(
                `**Tag:** ${member.user.tag}\n**ID:** ${member.user.id}\n**Bot:** ${member.user.bot ? "✅" : "❌"}\n**Created At: <t:${Math.round(parseInt(member.user.createdTimestamp) / 1000)}:F>**\n**Joined At: <t:${Math.round(
                    parseInt(member.joinedTimestamp) / 1000
                )}:F>**`
            )
            .setTimestamp();
        return msg.channel.send({ embeds: [userInfo] });
    } catch (err) {
        log(err);
        return;
    }
} else {
    try {
        let fetching = await client.users.fetch(args[0]);
        const userInfo = new MessageEmbed()
            .setAuthor({ name: `${fetching.tag}`, iconURL: fetching.displayAvatarURL({ dynamic: true }) })
            .setColor("BLUE")
            .setThumbnail(fetching.displayAvatarURL({ dynamic: true }))
            .setTitle("User Info")
            .setDescription(`**Tag:** ${fetching.tag}\n**ID:** ${fetching.id}\n**Bot:** ${fetching.bot ? "✅" : "❌"}\n**Joined At: <t:${Math.round(parseInt(fetching.createdTimestamp) / 1000)}:F>**`)
            .setTimestamp();
        return msg.channel.send({ embeds: [userInfo] });
    } catch (err) {
        log(err);
        return;
    }
}
about 4 years ago · Juan Pablo Isaza
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