python-teamspeak3 /

Filename Size Date modified Message
teamspeak3
38 B
Adding license and setup script.
423 B
Added tag 1.4.5 for changeset a2e0884f4c94
1.3 KB
Updating documentation to properly link.
619 B
Updating description.

Teamspeak3 API

This python module allows you to interact with an instance of Teamspeak running on your computer using Python rather than using the built-in lua interface.

Use

I wrote this library to satisfy a need on my part, so you can find a detailed example at teamspeak-notification, but briefly, let's go over subscribing to incoming messages the hard way:

import teamspeak3

client = teamspeak3.Client()
client.send_command(
    teamspeak3.Command(
        'clientnotifyregister',
        event='any',
        schandlerid='0'
    )
)

while True:
    messages = client.get_messages()
    for message in messages:
        if message.command == 'notifytextmessage':
            print message

in the above, you can see how you first create the client instance, and then send to teamspeak a command object asking that it register for incoming notifications-- I have written a shortcut for subscriptions, too, so the above can be simplified to:

import teamspeak3

client = teamspeak3.Client()
client.subscribe()

while True:
    messages = client.get_messages()
    for message in messages:
        if message.command == 'notifytextmessage':
            print message
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.