Skip to content

CurseLib is a library to interact with CurseVoice tchat and REST APIs.

License

Notifications You must be signed in to change notification settings

AlexMog/CurseLib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CurseLib

CurseLib is a library to interact with CurseVoice tchat and REST APIs.

Getting started

First of all, you will need to compile the sources of the library.

Clone this repository and use maven to compile sources.

Prerequisites:
  • Java 1.7
  • Maven 3.0.5

Build the project by using the following command (with tests):

$ mvn clean install

If you want to have a quicker build, you can avoid the tests:

$ mvn clean install -DskipITs

Example

Here is an example of usage of the library:

CurseClient client = new CurseClient("USER", "PASSWORD");
client.authenticate();
client.connectWS();

client.addListener(new ClientListener() {
    
    public void onOpen(ServerHandshake handshakedata) {
        System.out.println("I am connected to the tchat!");
    }
    
    public void onMessage(MessageEvent event) {
        System.out.println("New message received from @"
            + event.getMessage().getSender().getUsername() + ": " + event.getMessage().getText());
    }
    
    public void onError(Exception ex) {
        System.out.println("Error catched :(, but the client will still run.");
        ex.printStackTrace();
    }
    
    public void onClose(int code, String reason, boolean remote) {
        System.out.println("Connection closed " + (remote ? "by the server" : "") + ": (" + code + ")" + reason);
    }
});

About

CurseLib is a library to interact with CurseVoice tchat and REST APIs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages