A simple IRC client for Twitch
I recommend you to use a Maven project for your application. You can access this library via JitPack.
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.github.LukWebsForge</groupId>
<artifactId>TwitchChat</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
- Create an instance of the TwitchChat using
TwitchChat#build(String username, String oauth)
- Register your event listeners using
EventManager#register(Listener listener)
- Connect the instance to the Twitch IRC using
TwitchChat#connect()
- Join channels using
TwitchChat#getChannel(String channel)
TwitchChat chat = TwitchChat.build("twitchusername", "oauth:123456789abcdefghijklmn");
// You can get an oauth key at https://twitchapps.com/tmi/
chat.getEventManager().register(new Listener() {
@Handler
public void onJoin(UserJoinChannelEvent ev) {
System.out.println(ev.getUser().getName() + " joined channel " + ev.getChannel().getName());
}
});
chat.connect();
TwitchChannel channel = chat.getChannel("twitchchannel");
channel.sendMessage("Hello I'am here!");
Thread.sleep(Integer.MAX_VALUE);
If you want to contribute you can find helpful information at Twitch's developer documentation.
Your ideas and bugs are welcome.