Query available servers, channels and clients

A client can connect to multiple servers. To list all currently existing server connection handlers, call:

unsigned int ts3client_getServerConnectionHandlerList(result); 
uint64** result;
 

Returns ERROR_ok on success, otherwise an error code as defined in public_errors.h. If an error has occured, the result array is uninitialized and must not be released.


A list of all channels on the specified virtual server can be queried with:

unsigned int ts3client_getChannelList(serverConnectionHandlerID,  
 result); 
uint64 serverConnectionHandlerID;
uint64** result;
 

Returns ERROR_ok on success, otherwise an error code as defined in public_errors.h. If an error has occured, the result array is uninitialized and must not be released.


To get a list of all currently visible clients on the specified virtual server:

unsigned intts3client_getClientList(serverConnectionHandlerID,  
 result); 
uint64 serverConnectionHandlerID;
anyID** result;
 

Returns ERROR_ok on success, otherwise an error code as defined in public_errors.h. If an error has occured, the result array is uninitialized and must not be released.


To get a list of all clients in the specified channel if the channel is currently subscribed:

unsigned int ts3client_getChannelClientList(serverConnectionHandlerID,  
 channelID,  
 result); 
uint64 serverConnectionHandlerID;
uint64 channelID;
anyID** result;
 

Returns ERROR_ok on success, otherwise an error code as defined in public_errors.h. If an error has occured, the result array is uninitialized and must not be released.


To query the channel ID the specified client has currently joined:

unsigned int ts3client_getChannelOfClient(serverConnectionHandlerID,  
 clientID,  
 result); 
uint64 serverConnectionHandlerID;
anyID clientID;
uint64* result;
 

Returns ERROR_ok on success, otherwise an error code as defined in public_errors.h.


To get the parent channel of a given channel:

unsigned int ts3client_getParentChannelOfChannel(serverConnectionHandlerID,  
 channelID,  
 result); 
uint64 serverConnectionHandlerID;
uint64 channelID;
uint64* result;
 

Returns ERROR_ok on success, otherwise an error code as defined in public_errors.h.


Example code to print a list of all channels on a virtual server:

uint64* channels;

if(ts3client_getChannelList(serverID, &channels) == ERROR_ok) {
    for(int i=0; channels[i] != NULL; i++) {
        printf("Channel ID: %u\n", channels[i]);
    }
    ts3client_freeMemory(channels);
}

To print all visible clients:

anyID* clients;

if(ts3client_getClientList(scHandlerID, &clients) == ERROR_ok) {
    for(int i=0; clients[i] != NULL; i++) {
        printf("Client ID: %u\n", clients[i]);
    }
    ts3client_freeMemory(clients);
}

Example to print all clients who are member of channel with ID 123:

uint64 channelID = 123;  /* Channel ID in this example */
anyID *clients;

if(ts3client_getChannelClientList(scHandlerID, channelID) == ERROR_ok) {
    for(int i=0; clients[i] != NULL; i++) {
        printf("Client ID: %u\n", clients[i]);
    }
    ts3client_freeMemory(clients);
}