API

class ts3py.TS3Server(ip, port=10011)[source]
command(cmd, params={}, options=[])[source]

Send a command to the Teamspeak3-server and return the response.

Parameters:
  • cmd (string) – command
  • params (dict) – parameters appended to the command
  • options (list) – options appended to the command
Returns:

response of the command (if any)

Return type:

list

connect(ip, port=10011)[source]

Connect to a Teamspeak3-Server.

Parameters:
  • ip (string) – ip of the Teamspeak3-server
  • port (int) – port of the Teamspeak3-server’s query-interface
disconnect()[source]

Disconnect from the Teamspeak3-server.

ts3utils.build_command(cmd, params={}, options=[])[source]

Build query command-string from cmd, params and options.

Parameters:
  • cmd (str) – command
  • params (dict) – parameters for the command
  • options (list) – options for the command
ts3utils.escape(data)[source]

Escape to TS3Query-format.

Parameters:data (str) – data in normal form
ts3utils.parse_response(response)[source]

Parse raw response to a list of key-value-dicts.

Parameters:response (str) – query-response
Returns:list of parsed objects from response
Return type:list
ts3utils.unescape(data)[source]

Escape to normal-format.

Parameters:data (str) – data in escaped form