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

111
Vistas
How to make my Discord.js bot that leaves servers below a certain member count

I am making a discord.js bot and trying to get it verified! I want to make it so when you add it to a server and it has below 35 members it leaves it. This is so when I get it verified it doesn't think I am inorganically growing the bot. Is this possible?

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

0

DJS Documentation

In order to achieve this, you need to bring together different attributes and methods.

Client: GuildCreate Event

Guild: MemberCount

Guild: Leave

Sample

Start GuildCreate Event => 
    if (guild has less than 35 members) do 
         leave guild
    endif
endfunction
client.on('guildCreate', (guild) => {
    if (guild.memberCount < 35) {
        guild.leave();
    }
})
about 4 years ago · Juan Pablo Isaza Denunciar

0

So you can do this using a eval command on which I have done before the permissions you just need is the members intent and you can make it leave servers under the member count

client.guilds.cache.forEach(guild => {
    const memberCount = guild.members.cache.filter(member => !member.user.bot).size

// This filters out bots and only counts true members

    if (memberCount < 35) {
        guild.leave()
        console.log(`Left the ${guild.name} guild because they only had ${memberCount} members!`)
    }
})
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