NINÕ
NINÕ

Reputation: 11

how to get a list of the users connected in to a voice channel with discord.js / nodejs?

I'm trying to get a list / an array of users (username/id) connected to the voice channel of the one who launched the command. I feel like I'm on a good way but I don't find how to do this. for now, I tried message.member.voice.channel.members but It's a long list of information about who is in the channel. I only want their name / tag.

Upvotes: 1

Views: 2734

Answers (1)

vinesh_dodiya
vinesh_dodiya

Reputation: 150

try this:


    message.member.voice.channel.members.each(member=>{
       console.log(member.user.tag)
    })

for more info read official discord.js documentation

Upvotes: 1

Related Questions