Properties

$uuid

$uuid : array

UUID holds the User UUID

Type

array

$timeout

$timeout : integer

Timeout represents the HTTP timeout when HTTP requests to the SinusBot API are performed

Type

integer

$token

$token : string

Token is the SinusBot auth token which will be there temporary stored.

Type

string

$url

$url : string

URL is the SinusBot URL with the port and the HTTP protocol

Type

string

$headers

$headers : array

headers are http headers which will be added on every request

Type

array

$user

$user : array

User stores the initial received user data

Type

array

Methods

__construct()

__construct(\SinusBot\API  $api, array  $user) 

__construct

Parameters

\SinusBot\API $api

SinusBot API

array $user

SiusBot User array

addHeader()

addHeader(string  $key, string  $value) 

addHeader adds a header to every http request

Parameters

string $key

http header key

string $value

http header value

setAuthToken()

setAuthToken(string  $token) 

setAuthToken overrides the auth token

Parameters

string $token

Auth-Token, when you want to override

getName()

getName() : string

getName returns the username

Returns

string —

username

getUUID()

getUUID() : string

getUUID returns the uuid

Returns

string —

user UUID

setPassword()

setPassword(string  $password) : array

setPassword

Parameters

string $password

Password

Returns

array —

status

setPrivileges()

setPrivileges(integer  $privileges) : array

setPrivileges

Parameters

integer $privileges

Bitmask-Value

Returns

array —

status

setIdentity()

setIdentity(string  $identity) : array

setIdentity

Parameters

string $identity

teamspeak identity

Returns

array —

status

setServergroup()

setServergroup(string  $groupID) : array

setServergroup

Parameters

string $groupID

TeamSpeak Group ID

Returns

array —

status

delete()

delete() : array

delete

Returns

array —

status

request()

request(string  $path, string  $method = "GET", string  $payload = null, boolean  $encoded = false) : array

request executes a request to the SinusBot API

Parameters

string $path

/api/v1/

string $method

http method

string $payload

http POST payload

boolean $encoded

when not encoded it will be JSON marshalled

Returns

array —

decoded JSON response

getError()

getError(integer  $code) : string

getError returns the string representive to the given http status code

Parameters

integer $code

http status code

Returns

string —

http status code string representive