Awesome
League of Legends XMPP Chat Library
A Java 7 XMPP library to chat and interact with the League of Legends chatservers. Built upon Smack and JDOM.
Features
- Documented source
- Event-based chat system
- Automatic reconnecting
- Managing of Friends and FriendGroups
- Fetch metadata of friends (level, current division, ...)
- Riot API supported (https://developer.riotgames.com)
Getting Started
Download
-
Option 1 (Standalone Jar):
Download the <a href="https://search.maven.org/remote_content?g=com.github.theholywaffle&a=lolchatapi&v=LATEST&c=with-dependencies" target="_blank">latest release</a> and add it to the buildpath of your project.
-
Option 2 (Maven):
<dependency>
<groupId>com.github.theholywaffle</groupId>
<artifactId>lolchatapi</artifactId>
<version><!--latest version--></version>
</dependency>
Usage
- Create a LolChat object with the correct ChatServer of your region.
- Add any listeners.
- Login.
- ...
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!");
}
}
Javadocs
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.”