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

180
Vistas
My server info command is showing 1 human and 1 bot, I have 10 bots and 3 users

I have 10 humans and 3 user in my discord server but my bot shows only 2 total members, 1 human and 1 bot. Can someone help me fix it so that it shows the whole number of members in the server? This is the code -

Total -

.addField('Total Members', `${interaction.guild.members.cache.size}`, true)

Humans -

.addField('Human Users', `${interaction.guild.members.cache.filter(members => !members.user.bot).size}`, true)

Bots -

.addField('Bots', `${interaction.guild.members.cache.filter(members => members.user.bot).size}`, true)

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

0

There are multiple ways to solve this issue

#1: Do you have intents?

const client = new Discord.Client({ intents: ['GUILDS', 'GUILD_MEMBERS'] })

#2: Have you tried fetching all the members in the guild before showing? Discord.js uses something called "cache", where the package stores something in it's database, and you can do whatever you want with it later on without making a new API request to Discord everytime you want to do something (for example, getting a channel's name). Discord.js tries to cache everything it can while it can. If they are not in your cache, then you can fetch it, and add it to the cache manually.

See GuildMemberManager#fetch

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