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

133
Vistas
Why is my Discord bot only fetching online users?

I have created a simple Discord bot in Node.js. I've enabled GUILD_MEMBERS and GUILD_PRESENCES intents, yet when I try and fetch all members, it is only returning online members.

import { Client } from "discord.js";
const client = new Client({intents: ["GUILDS","GUILD_MESSAGES","GUILD_MEMBERS","GUILD_MESSAGE_REACTIONS", "GUILD_PRESENCES"]});

const guildId = '<guild_id>';

client.on("ready", async () => {
    console.log(`logged in as ${client.user.tag}`);
    const guild = await client.guilds.fetch(guildId);
    const members = await guild.members.fetch();
    
    members.forEach(member => console.log(member.displayName);
});

Output, with my main account online and my alt offline:

logged in as bot1#tagg
mainaccount
bot1

Output, with my main account online and my alt online:

logged in as bot1#tagg
mainaccount
altaccount
bot1

And when I change the log to console.log(member.presence.status), the output is

logged in as bot1#tagg
online
online
online

As you can see, I am fetching all members and logging their display names. I currently have my main account, my alt account and the bot account in the server, but it only logs the names of the members that are currently online. Why is this, and how can I fix it?

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