How to get who is watching a stream with Discord.js

Viewed 669

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.

2 Answers

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
Related