Home

Awesome

TeamSpeak 3 Java API

Build Status Maven Central Javadocs Gitter

A Java wrapper of the TeamSpeak 3 Server Query API

Features

Getting Started

Download

Usage

All functionality is contained in the TS3Api object.

  1. Create a TS3Config object and customize it.
  2. Create a TS3Query object with your TS3Config as argument.
  3. Call TS3Query#connect() to connect to the server.
  4. Call TS3Query#getApi() to get an TS3Api object.
  5. Do whatever you want with this api :)

Example

final TS3Config config = new TS3Config();
config.setHost("77.77.77.77");

final TS3Query query = new TS3Query(config);
query.connect();

final TS3Api api = query.getApi();
api.login("serveradmin", "serveradminpassword");
api.selectVirtualServerById(1);
api.setNickname("PutPutBot");
api.sendChannelMessage("PutPutBot is online!");
...

More examples

here

Extra notes

FloodRate

Only use FloodRate.UNLIMITED if you are sure that your query account is whitelisted (query_ip_whitelist.txt in Teamspeak server folder). If not, use FloodRate.DEFAULT. The server will temporarily ban your account if you send too many commands in a short period of time. For more info on this, check the TeamSpeak 3 Server Query Manual, page 6.

TS3Config Settings

OptionDescriptionMethod signatureDefault valueRequired
Host/IPIP/Host of TeamSpeak 3 server.setHost(String)yes
QueryPortQuery port of TeamSpeak 3 server.setQueryPort(int)10011no
FloodRatePrevents possible spam to the server.setFloodRate(FloodRate)FloodRate.DEFAULTno
Communications loggingLog client-server communication.setEnableCommunicationsLogging(boolean)falseno
Command timeoutTime until a command waiting for a response failssetCommandTimeout(int)4000 (ms)no

Questions or bugs?

Please let us know here. We'll try to help you as soon as we can.

If you just have a simple question or want to talk to us about something else, please join the repository chat on Gitter.