guild.voiceStates.cache force update?
When trying to get all users in a voicechannel, they are still in the cache after leaving. Is it possible to get an accurate count of users in voice channels?
function getActiveUsers(server) {
return server?.voiceStates?.cache.map(channel => channel?.member?.user?.username);
}npm list discord.js and node node -v version?✅ Marked as resolved by OPchannelId property, which is null if the user isn't in a channelvoiceState or just state. It's not a voice channel, not even a channel.Is it possible to get an accurate count of users in voice channels?
channelIdvoiceStateGatewayIntentBits.GuildVoiceStates,
641