TheHolyWaffle / League-of-Legends-XMPP-Chat-Library

A Java 7 XMPP API to chat and interact with the League of Legends ChatServers.
MIT License
58 stars 23 forks source link

League of Legends XMPP Chat Library

Build Status Maven Central Dependency Status

A Java 7 XMPP library to chat and interact with the League of Legends chatservers. Built upon Smack and JDOM.

Features

Getting Started

Download

Usage

  1. Create a LolChat object with the correct ChatServer of your region.
  2. Add any listeners.
  3. Login.
  4. ...

Example

final LolChat api = new LolChat(ChatServer.EUW, FriendRequestPolicy.ACCEPT_ALL, new RiotApiKey("RIOT-API-KEY", RateLimit.DEFAULT));
if (api.login("myusername", "mypassword")) {

    // Example 1: Send Chat Message to all your friends
    for (Friend f : api.getFriends()) {
        f.sendMessage("Hello " + f.getName());
    }

    // Example 2: Send Chat Message to all your friends and wait for an
    // response
    for (Friend f : api.getFriends()) {
        f.sendMessage("Hello " + f.getName(), new ChatListener() {

            @Override
            public void onMessage(Friend friend, String message) {
                System.out.println("Friend " + friend.getName()
                        + " responded to my Hello World!");
            }
        });
    }

    // Example3: Send Chat Message to an specific friend
    Friend f = api.getFriendByName("Dyrus");
    if (f != null && f.isOnline()) {
        f.sendMessage("Hi, I'm your biggest fan!");
    }
}

more examples

Javadocs

here

Questions or bugs?

Please let me know them here. I'll help you out as soon as I can.


“League of Legends XMPP Chat Library isn't endorsed by Riot Games and doesn't reflect the views or opinions of Riot Games or anyone officially involved in producing or managing League of Legends. League of Legends and Riot Games are trademarks or registered trademarks of Riot Games, Inc. League of Legends © Riot Games, Inc.”