Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

175
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!