PHP TeamSpeak 3 WebQuery client.
Note: This package is still under active development and is not yet ready for production use.
To see all commands that implemented, see COMMANDS.
Requires PHP 8.4+
You can install the package via composer:
composer require teamspeakphp/web-query
To print names of the all channels:
$teamspeak = TeamSpeak::client('100.100.100.100:10080', 'my-api-key', 1);
$channels = $teamspeak->channels()->list()->channels;
foreach ($channels as $channel) {
echo 'Found channel '.$channel->name.PHP_EOL;
}
To print nicknames with IP addresses of the first 100 clients in the database:
$teamspeak = TeamSpeak::client('100.100.100.100:10080', 'my-api-key', 1);
$clients = $teamspeak->databaseClients()->list(limit: 100)->clients;
foreach ($clients as $client) {
echo sprintf('Database client: %s (%s)', $client->nickname, $client->lastIpAddress);
}
Method TeamSpeak::client(...)
connects to the server through ID of the virtual server, but you can connect through the port of your server using the factory:
$teamspeak = TeamSpeak::factory()
->withBaseUri('100.100.100.100:10080')
->withApiKey('my-api-key')
->withPort(9987)
->make();
composer test