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

137
Vistas
discord.js v13 check if member is in a server

I want to check if a member is or not in a server.
This is my current code:

function CheckIfManagerIsInServer(client, server_id, member) {
    let isIn = { isIn: true, isNotIn: [] };

    if (CheckIfIsInChain(server_id)) {
        database.chains.forEach(chain => {
            if(chain.membersID.includes(server_id)) {
                chain.members.forEach(server => {

                    const guild = client.guilds.cache.get(server)

                    // check if member is in the server

                })
            }
        })
    }

    return isIn;
}

member parameter is the id of the member.
How i can check if the member is or not in the server (guild)? I'm using v13.5.0.
My bot is verified and it has GUILD_MEMBERS enabled.
I have tried multiple methods but they doesn't works.
How I can do?
Thank you in advance and sorry for bad english!

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

For checking that you can do like this

if (guild.members.cache.find(m => m.id === member)?.id) {
    // true
} else {
    // false
}
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