/DubTrack4J

A Java API for Dubtrack.

Primary LanguageJavaMIT LicenseMIT

DubTrack4J

A Java API for Dubtrack.

Build Status JitPack

Maven

This project uses JitPack as a maven repository (for now).

Respository:

<repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
</repository>

Dependency:

<dependency>
    <groupId>com.github.sponges</groupId>
    <artifactId>dubtrack4j</artifactId>
    <version>1.06-SNAPSHOT</version>
</dependency>

Usage

Creating your DubtrackAPI Builder instance:
DubtrackBuilder builder = new DubtrackBuilder(username, password);
// here you can set the properties with the builder instance
DubtrackAPI dubtrack = builder.buildAndLogin();
Joining a room:

This method takes a String room name, which is found at the end of the join url. http://dubtrack.fm/join/RoomName

Room room = dubtrack.joinRoom(roomName);
Listening for events:

The EventBus class uses consumers to handle events.

dubtrack.getEventBus().register(UserChatEvent.class, event -> {
    System.out.println("Got message: " + event.getMessage().getContent());
});

See the Event package to see all the available events.

Sending a message
room.sendMessage("This is a message!");
Other stuff

Check out the javadocs @ placeholder.exe