MCPcopy Index your code
hub / github.com/TheHolyWaffle/TeamSpeak-3-Java-API

github.com/TheHolyWaffle/TeamSpeak-3-Java-API @v1.3.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.3.1 ↗ · + Follow
1,506 symbols 3,586 edges 136 files 484 documented · 32%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

TeamSpeak 3 Java API

Build Status Maven Central Javadocs Gitter

A Java wrapper of the TeamSpeak 3 Server Query API

Features

  • Contains almost all server query functionality! (see TeamSpeak 3 Server Query Manual)
  • Built-in keep alive method
  • Threaded event-based system
  • Both synchronous and asynchronous implementations available
  • Can be set up to reconnect and automatically resume execution after a connection problem
  • Utilizes SLF4J for logging abstraction and integrates with your logging configuration

Getting Started

Download

  • Option 1 (Standalone Jar):

    Download the latest release and add this jar to the buildpath of your project.

  • Option 2 (Maven):

    Add the following to your pom.xml:

    xml <dependency> <groupId>com.github.theholywaffle</groupId> <artifactId>teamspeak3-api</artifactId> <version>...</version> </dependency>

    This API utilizes SLF4J for logging purposes and doesn't come shipped with a default logging implementation, if you use Maven instead of the standalone jar. You will manually have to add one via Maven to get any logging going, if you don't have one already.

    The easiest way to do so is to just add SimpleLogger to your project, which also supports configuration via config file (needs to be shipped as a resource with your jar), if you want to log DEBUG messages for instance (e.g. raw client-server communication).

    See this configuration example for SimpleLogger. Add the following to your pom.xml to get started:

    xml <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-simple</artifactId> <version>1.7.25</version> </dependency>

    You can however choose whichever logging framework suits your needs best. Just add your logging framework and the corresponding binding to your pom.xml.

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

Option Description Method signature Default value Required
Host/IP IP/Host of TeamSpeak 3 server. setHost(String) yes
QueryPort Query port of TeamSpeak 3 server. setQueryPort(int) 10011 no
FloodRate Prevents possible spam to the server. setFloodRate(FloodRate) FloodRate.DEFAULT no
Communications logging Log client-server communication. setEnableCommunicationsLogging(boolean) false no
Command timeout Time until a command waiting for a response fails setCommandTimeout(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.

Extension points exported contracts — how you extend this code

TS3Event (Interface)
(no doc) [13 implementers]
src/main/java/com/github/theholywaffle/teamspeak3/api/event/TS3Event.java
ConnectionHandler (Interface)
(no doc) [5 implementers]
src/main/java/com/github/theholywaffle/teamspeak3/api/reconnect/ConnectionHandler.java
TS3Listener (Interface)
Interface used to listen to events from a TeamSpeak3 server. Directly using this interface requires implementing [3 implementers]
src/main/java/com/github/theholywaffle/teamspeak3/api/event/TS3Listener.java
Property (Interface)
(no doc) [4 implementers]
src/main/java/com/github/theholywaffle/teamspeak3/api/Property.java
SuccessListener (Interface)
A listener which will be notified if the CommandFuture succeeded. In that case, #handleSuccess(Object) w [1 implementers]
src/main/java/com/github/theholywaffle/teamspeak3/api/CommandFuture.java

Core symbols most depended-on inside this repo

getUninterruptibly
called by 236
src/main/java/com/github/theholywaffle/teamspeak3/api/CommandFuture.java
add
called by 235
src/main/java/com/github/theholywaffle/teamspeak3/commands/CommandBuilder.java
getInt
called by 163
src/main/java/com/github/theholywaffle/teamspeak3/api/wrapper/Wrapper.java
build
called by 128
src/main/java/com/github/theholywaffle/teamspeak3/commands/CommandBuilder.java
get
called by 117
src/main/java/com/github/theholywaffle/teamspeak3/api/wrapper/Wrapper.java
getLong
called by 110
src/main/java/com/github/theholywaffle/teamspeak3/api/wrapper/Wrapper.java
executeAndReturnError
called by 69
src/main/java/com/github/theholywaffle/teamspeak3/TS3ApiAsync.java
getBoolean
called by 47
src/main/java/com/github/theholywaffle/teamspeak3/api/wrapper/Wrapper.java

Shape

Method 1,357
Class 120
Enum 22
Interface 7

Languages

Java100%

Modules by API surface

src/main/java/com/github/theholywaffle/teamspeak3/TS3ApiAsync.java176 symbols
src/main/java/com/github/theholywaffle/teamspeak3/TS3Api.java164 symbols
src/main/java/com/github/theholywaffle/teamspeak3/api/wrapper/VirtualServerInfo.java85 symbols
src/main/java/com/github/theholywaffle/teamspeak3/api/wrapper/Client.java38 symbols
src/main/java/com/github/theholywaffle/teamspeak3/api/event/ClientJoinEvent.java36 symbols
src/main/java/com/github/theholywaffle/teamspeak3/api/wrapper/ClientInfo.java35 symbols
src/test/java/com/github/theholywaffle/teamspeak3/commands/FileCommandsTest.java32 symbols
src/main/java/com/github/theholywaffle/teamspeak3/commands/PermissionCommands.java28 symbols
src/main/java/com/github/theholywaffle/teamspeak3/api/CommandFuture.java28 symbols
src/main/java/com/github/theholywaffle/teamspeak3/TS3Config.java23 symbols
src/main/java/com/github/theholywaffle/teamspeak3/api/wrapper/ChannelBase.java21 symbols
src/main/java/com/github/theholywaffle/teamspeak3/api/reconnect/ReconnectStrategy.java21 symbols

For agents

$ claude mcp add TeamSpeak-3-Java-API \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page