PHP code example of bennetgallein / ts3ab-api

1. Go to this page and download the library: Download bennetgallein/ts3ab-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

bennetgallein / ts3ab-api example snippets


$bot = new \TS3AB\Ts3AudioBot("192.168.1.104", "3306");

$bot->basicAuth("j+W41OpXcHv8In9vt/Q2x+UmUPs=:ts3ab:X38WCfV3srBQBYUYZVkMnpxyBPWlMxZs");

var_dump($bot->getCommandExecutor()->list()); // lists all active bots
$bot->getCommandExecutor()->use(0); // tells the API to use bot "0"

var_dump($bot->getCommandExecutor()->play("https://www.youtube.com/watch?v=xxxx"));

$history = $bot->getCommandExecutor()->history();

$history->add(0);

$history->clean();

$history->cleanRemovedefective();

$history->delete(0);

$history->historyFrom(10, <userid>);

$history->historyID(0);

$history->last(10);

$history->playLast();

$history->play(2);

$history->rename(0, "new title");

$history->till("today");

$history->filterTitle("filter");