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

208
Views
How to get users in voice channel without cache in DiscordJS?

I'm trying to get all users inside voice channel in my server. When someone talks to bot in #general, I want to get the users inside Voice Channel 1. I'm using Node 17 and DiscordJS 13

This is my code:

message.guild.channels.fetch(channelID, {cache: false, force: true}).then(channels => {
    console.log(channels.members);
});

Also, I tried with this one:

let voiceChannel = client.guilds.cache.get(process.env.DISCORDJS_GUILD_ID).channels.cache.get(process.env.DISCORDJS_CHANNEL_ID);
let membersInChannel = voiceChannel.members;
console.log(membersInChannel);

But, it always return the voice channel users that joined when I start the node app. If someone leaves the voice channel, it keeps showing him in the console.log when I say something to the bot in #general. How can I achieve this?

about 4 years ago · Juan Pablo Isaza
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!