The Kitteh IRC Client Library (KICL) is a powerful, modern Java IRC library built with NIO using the Netty library to maximize performance and scalability.
import org.kitteh.irc.client.library.Client;
import org.kitteh.irc.client.library.event.channel.ChannelJoinEvent;
import org.kitteh.irc.lib.net.engio.mbassy.listener.Handler;
public class Example {
public static class Listener {
@Handler
public void onUserJoinChannel(ChannelJoinEvent event) {
if (event.getClient().isUser(event.getUser())) { // It's me!
event.getChannel().sendMessage("Hello world! Kitteh's here for cuddles.");
return;
}
// It's not me!
event.getChannel().sendMessage("Welcome, " + event.getUser().getNick() + "! :3");
}
}
public static void main(String[] args) {
// Calling build() starts connecting.
Client client = Client.builder().nick("Kitteh").serverHost("127.0.0.1").build();
client.getEventManager().registerEventListener(new Listener());
client.addChannel("#kicl");
}
}
<dependency>
<groupId>org.kitteh.irc</groupId>
<artifactId>client-lib</artifactId>
<version>2.3.2</version>
</dependency>
Releases are available on Maven Central.
Snapshots are available on the Sonatype OSSRH: https://oss.sonatype.org/content/repositories/snapshots