List channels

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

unsigned int ts3server_getChannelList(uint64 serverID, uint64 **result)

list all channels on the server

Parameters:
  • serverID – the server to get the list of channels on

  • result – address of a variable to receive a zero terminted array of channel ids. Like {4, 65, 23, …, 0} Memory is allocated by the server library and caller must free the array using ts3server_freeMemory

Returns:

An Error code from the Ts3ErrorType enum indicating either success or the failure reason

To query the current channel of a client use

unsigned int ts3server_getChannelOfClient(uint64 serverID, anyID clientID, uint64 *result)

get the id of the clients current channel

Parameters:
  • serverID – specifies the server the client is on

  • clientID – the client to get the channel of

  • result – address of a variable to receive the channel id

Returns:

An Error code from the Ts3ErrorType enum indicating either success or the failure reason

Get the parent channel of a given channel with

unsigned int ts3server_getParentChannelOfChannel(uint64 serverID, uint64 channelID, uint64 *result)

get the parent channel of a channel

Parameters:
  • serverID – the server on which the channel is located

  • channelID – the channel of which to get the parent channel

  • result – address of a variable to receive the parent channel id

Returns:

An Error code from the Ts3ErrorType enum indicating either success or the failure reason

Example

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

1uint64* channels;
2
3if (ts3server_getChannelList(serverID, &channels) == ERROR_ok) {
4    for (int i = 0; channels[i] != NULL; i++) {
5        printf("Channel ID: %u\n", channels[i]);
6    }
7    ts3server_freeMemory(channels);
8}