A Java 7 XMPP library to chat and interact with the League of Legends chatservers. Built upon Smack and JDOM.
- 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)
-
Option 1 (Standalone Jar):
Download the latest release 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>
- Create a LolChat object with the correct ChatServer of your region.
- Add any listeners.
- Login.
- ...
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!");
}
}
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.”