dev-master
9999999-devOOP API Wrapper for the TS3AudioBot WebAPI
LGPL-3.0
The Requires
- php >=7.1
- bennetgallein/angle-framework master
by bennetgallein
OOP API Wrapper for the TS3AudioBot WebAPI
OOP API Wrapper for the TS3AudioBot WebAPI, (*1)
This Wrapper is meant to make work with the TS3AudioBot WebAPI over PHP easier. It provides (in the future) all functions that the bot supports., (*2)
Warning: This is based on the development branch! Do not use funtions that are only available there or you'll encounter some bad errors!, (*3)
This is more of a sideproject than a dedicated one, since I needed an easier way to communicate between a PHP-Backend with the Bot's API., (*4)
PHP Version Required: 7.1, (*5)
Install view composer:, (*6)
composer require bennetgallein/ts3ab-api
$bot = new \TS3AB\Ts3AudioBot("192.168.1.104", "3306");
$bot->basicAuth("j+W41OpXcHv8In9vt/Q2x+UmUPs=:ts3ab:X38WCfV3srBQBYUYZVkMnpxyBPWlMxZs");
Read more about Authentication in the official Wiki., (*7)
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();
Adds the song with
$history->add(0);
Cleans up the history file for better startup performance., (*9)
$history->clean();
Cleans up the history file for better startup performance. Also checks for all links in the history which cannot be opened anymore., (*10)
$history->cleanRemovedefective();
Removes the entry with
$history->delete(0);
Gets the last
$history->historyFrom(10, <userid>);
Displays all saved informations about the song with
$history->historyID(0);
Gets the last
$history->last(10);
Plays the last song again, (*15)
$history->playLast();
Playes the song with
$history->play(2);
Sets the name of the song with
$history->rename(0, "new title");
Gets all songs played until
$history->till("today");
Gets all songs which title contains
$history->filterTitle("filter");
Atm the return value of all funtions is the pure answer from the TS3AB API, which may change in the future., (*20)
OOP API Wrapper for the TS3AudioBot WebAPI
LGPL-3.0