I want to get list of connected users in a specific channel on voiceStateUpdate with this way:
module.exports = async (client, oldState, newState) => {
const channel = await newState.guild.channels.fetch('719030671384772609');
}
but I don't see members property when checking the collections,
'channelid' => <ref *8> VoiceChannel {
type: 'GUILD_VOICE',
deleted: false,
guild: Guild {
},
guildId: '',
parentId: '',
permissionOverwrites: PermissionOverwriteManager { channel: [Circular *8] },
id: '',
name: '',
rawPosition: 2,
rtcRegion: 'hongkong',
bitrate: 64000,
userLimit: 0
},
Did I miss something here? or an alternative way?
One way you can get a list of all connected users using something like this
newState.guild.channels.cache.get("channelID here").members