2017 © Pedro Peláez
 

library ts3ab-api

OOP API Wrapper for the TS3AudioBot WebAPI

image

bennetgallein/ts3ab-api

OOP API Wrapper for the TS3AudioBot WebAPI

  • Monday, July 16, 2018
  • by BennetPHP
  • Repository
  • 3 Watchers
  • 4 Stars
  • 17 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

TS3AB-API

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)

Intention

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)

Installation

PHP Version Required: 7.1, (*5)

Install view composer:, (*6)

composer require bennetgallein/ts3ab-api

Get started

  1. Make a connection:
$bot = new \TS3AB\Ts3AudioBot("192.168.1.104", "3306");
  1. Authenticate
$bot->basicAuth("j+W41OpXcHv8In9vt/Q2x+UmUPs=:ts3ab:X38WCfV3srBQBYUYZVkMnpxyBPWlMxZs");

Read more about Authentication in the official Wiki., (*7)

  1. Select the correct bot. Since TS3AB allows multi-instances to run at the same time, you need to choose the context you want to work with.
var_dump($bot->getCommandExecutor()->list()); // lists all active bots
$bot->getCommandExecutor()->use(0); // tells the API to use bot "0"
  1. Execute commands.
var_dump($bot->getCommandExecutor()->play("https://www.youtube.com/watch?v=xxxx"));

History

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

Adds the song with to the queue, (*8)

$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 from the history., (*11)

$history->delete(0);

Gets the last songs from the user with the given "., (*12)

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

Displays all saved informations about the song with (also can be last|next), (*13)

$history->historyID(0);

Gets the last played songs., (*14)

$history->last(10);

Plays the last song again, (*15)

$history->playLast();

Playes the song with , (*16)

$history->play(2);

Sets the name of the song with to , (*17)

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

Gets all songs played until . Any of those desciptors: (hour|today|yesterday|week), (*18)

$history->till("today");

Gets all songs which title contains , (*19)

$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)

The Versions

16/07 2018

dev-master

9999999-dev

OOP API Wrapper for the TS3AudioBot WebAPI

  Sources   Download

LGPL-3.0

The Requires

 

by bennetgallein