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

135
Views
El bucle de miembros de Discord js devuelve solo un usuario

Quiero que todos los usuarios de mis servidores estén listos para mi bot de discordia para poder agregarlos a una base de datos.

Tengo todos los intentos de puerta de enlace privilegiados de discord activados. Pero solo obtengo la identificación de un solo usuario con el siguiente código:

 client.once('ready', () => { client.guilds.cache.values().next().value.members.list().then((members) => { members.each(member => { console.log(member.id) }); }) })

Estoy seguro de que he incluido toda la intención que sería necesaria al crear mi cliente:

 const client = new Client({ intents: ["GUILDS", "GUILD_MEMBERS", "GUILD_BANS", "GUILD_EMOJIS_AND_STICKERS", "GUILD_INTEGRATIONS", "GUILD_WEBHOOKS", "GUILD_INVITES", "GUILD_VOICE_STATES", "GUILD_PRESENCES", "GUILD_MESSAGES", "GUILD_MESSAGE_REACTIONS", "GUILD_MESSAGE_TYPING"]} )

No sé por qué proporciona la identificación de solo 1 miembro (propietario) mientras que el servidor de prueba tiene 3 miembros, incluido el bot.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

client.guilds.cache.get(guild_id).members.cache.map(member => member.id)
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!