Multivit4min / TS3-NodeJS-Library

TeamSpeak 3 Server Query Library supports SSH and RAW Query
https://multivit4min.github.io/TS3-NodeJS-Library/
MIT License
149 stars 20 forks source link

Help with TeamSpeakChannel #153

Closed MongoVFR closed 3 years ago

MongoVFR commented 3 years ago

Hi I am trying to write a function that will get the names of all clients currently connected to a certain channel. I have been trying at this for a few weeks and am completely stuck on what to do. I got the query to connect to my server and send messages but can't figure out how to use the TeamSpeakChannel Class. Any help would be greatly appreciated! Thank you in advance!

Multivit4min commented 3 years ago

depending on what you know (assuming you have a channel id) you can get the channel with

const channel = await teamspeak.getChannelById(cid)

after this your variable channel is either undefined if the channel has not been found or it is the TeamSpeakChannel class from here

if you want to get all clients from that channel you just do this:

const clients = await channel.getClients()