Skip to content
This repository has been archived by the owner on Nov 25, 2017. It is now read-only.

Latest commit

 

History

History
84 lines (61 loc) · 3.19 KB

File metadata and controls

84 lines (61 loc) · 3.19 KB

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

  • 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>

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.”