From 70ee4f052cf570c4481d4f1171d1e3af85c8a603 Mon Sep 17 00:00:00 2001 From: Krzysztof Jagiello Date: Sat, 4 Jun 2011 20:29:07 +0200 Subject: [PATCH] example of using python-ts3 and install tutorial --- README.rst | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/README.rst b/README.rst index d9c645a..442dce5 100644 --- a/README.rst +++ b/README.rst @@ -5,3 +5,36 @@ python-ts3 python-ts3 is a abstraction library around the Teamspeak 3 ServerQuery API. It allows native access to the ServerQuery API with most of the formatting headaches avoided. + + +Install +======== + +Download the most recent sourcecode and install it: + + git clone git://github.com/Balon/python-ts3.git + cd python-ts3 + python setup.py install # sudo this + + +Example +======== + +Example showing how to create a channel and sub-channel for it using python-ts3 library: + + import ts3 + + server = ts3.TS3Server('127.0.0.1', 10011) + server.login('serveradmin', 'secretpassword') + + # choose virtual server + server.use(1) + + # create a channel + response = server.send_command('channelcreate', keys={'channel_name': 'Just some channel'}) + + # id of the newly created channel + channel_id = response.response['keys']['cid'] + + # create a channel + server.send_command('channelcreate', keys={'channel_name': 'Just some sub-channel', 'cpid': channel_id})