In a voice channel, how to fetch the members watching a stream in the same voice channel using Discord.js?
It seems like onVoiceStateUpdate is not triggered when a user starts watching a stream.
In a voice channel, how to fetch the members watching a stream in the same voice channel using Discord.js?
It seems like onVoiceStateUpdate is not triggered when a user starts watching a stream.
I have looked at the Discord.js docs and can't seem to find any events that return viewers of a stream. Hopefully in v13 they add this.
Alternatively you could get the number of people in the voice chat - would not necessarily be accurate, but it would be a possible way around it:
let voiceChannel = message.guild.channels.cache.find(c => c.id === '<voice channel id goes here>');
message.channel.send(voiceChannel.members.size;); //sends number of users in the voicechannel
The voice state structure only contains a boolean value "self_stream", so it's unlikely that this is possible without changes to the discord api
https://discord.com/developers/docs/resources/voice#voice-state-object-voice-state-structure