All Projects → Gikkman → Java Twirk

Gikkman / Java Twirk

Licence: mit
Small, basic library for communication via the Twitch chat. Java 8 compatible

Programming Languages

java
68154 projects - #9 most used programming language

Labels

Projects that are alternatives of or similar to Java Twirk

mIRC-Twitch-Scripts
Various scripts and games to use with a mIRC bot designed for Twitch.tv
Stars: ✭ 30 (-16.67%)
Mutual labels:  twitch, irc
twitch-bot-tutorial
Official repo of the "Building a Python Twitch bot (2020)" series.
Stars: ✭ 21 (-41.67%)
Mutual labels:  twitch, irc
twitch-chat-bot
No description or website provided.
Stars: ✭ 63 (+75%)
Mutual labels:  twitch, irc
Tc
A desktop chat client for Twitch
Stars: ✭ 182 (+405.56%)
Mutual labels:  twitch, irc
recent-messages2
Service to provide historical messages to Twitch chat clients
Stars: ✭ 21 (-41.67%)
Mutual labels:  twitch, irc
Twitch4j
Modular Async/Sync/Reactive Twitch API Client / IRC Client
Stars: ✭ 209 (+480.56%)
Mutual labels:  twitch, irc
twitch-irc-rs
Twitch IRC library for the Rust programming language
Stars: ✭ 58 (+61.11%)
Mutual labels:  twitch, irc
TwitchPy
This is a package you can use to connect with the Twitch API, manage a channel, create bots, etc
Stars: ✭ 22 (-38.89%)
Mutual labels:  twitch, irc
godot-twicil
Godot TwiCIL – Godot Twitch Chat Interaction Layer
Stars: ✭ 57 (+58.33%)
Mutual labels:  twitch, irc
twitch-chatlog
Fetch the chatlog to a twitch VOD from your command line.
Stars: ✭ 78 (+116.67%)
Mutual labels:  twitch, irc
Go Twitch Irc
go irc client for twitch.tv
Stars: ✭ 155 (+330.56%)
Mutual labels:  twitch, irc
Multistreamer
[discontinued] A webapp for publishing video to multiple streaming services at once.
Stars: ✭ 281 (+680.56%)
Mutual labels:  twitch, irc
Twitch Bot
🤖 Easily create chat bots for Twitch.tv
Stars: ✭ 111 (+208.33%)
Mutual labels:  twitch, irc
jChat
jChat is an overlay that allows you to show your Twitch chat on screen with OBS, XSplit, and any other streaming software that supports browser sources.
Stars: ✭ 106 (+194.44%)
Mutual labels:  twitch, irc
Twitchirc Unity
lightweight IRC client component for use with the Unity Engine.
Stars: ✭ 81 (+125%)
Mutual labels:  twitch, irc
twitchchat
interface to the irc portion of Twitch's chat
Stars: ✭ 80 (+122.22%)
Mutual labels:  twitch, irc
bot
A Go package for building Twitch.tv IRC chat bots. Previously "twitchbot".
Stars: ✭ 17 (-52.78%)
Mutual labels:  twitch, irc
Matterbridge
bridge between mattermost, IRC, gitter, xmpp, slack, discord, telegram, rocketchat, twitch, ssh-chat, zulip, whatsapp, keybase, matrix, microsoft teams, nextcloud, mumble, vk and more with REST API (mattermost not required!)
Stars: ✭ 4,452 (+12266.67%)
Mutual labels:  twitch, irc
Virtualproduction Vrchat
Multicam Virtual Reality Production Rig + Crane + Overlays for VRChat
Stars: ✭ 18 (-50%)
Mutual labels:  twitch
Irc Colors.js
Color and formatting for irc bots made easy. Inspired by colors.js and cli-color.
Stars: ✭ 26 (-27.78%)
Mutual labels:  irc

Java-Twirk

Small, library for creating an IRC connection to the Twitch chat.

The library is intended to make communication via Twitch chat as easy as possible, and uses Java objects to represent most events that can occur in Twitch chat.

Java 8 compatible.

Installation

Include the following in your pom.xml

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>
<dependencies>
    <dependency>
        <groupId>com.github.gikkman</groupId>
        <artifactId>Java-Twirk</artifactId>
        <version>0.6.3</version>
    </dependency>
</dependencies>

Or simply download the latest version of the library jar from the release page.

Changes

0.6.3

Some pretty big changes behind the scenes, but they should be fully backwards compatible. Below is a list of changes:

  • Cheer.getImageURL(...) should now return a proper URL. Fix #30
  • You can now set a custom PING interval, for how often the connection should ping Twitch. See TwirkBuilder.setPingInterval Fix #29
  • You can now assign custom log methods to Twirk, in case you use some kind of logging framework. See TwirkBuilder.setXXXLogMethod. Fix #28 (thanks to PR #31).
  • Calling connect after a disconnect should now work. Fix #26
  • You don't need to include the '#' anymore in the channel name. Fix #21

0.6.2

Hotfix release since some emote IDs were still not parsed correctly (see #22). This hotfix should hopefully fix this issue. Please report any further issues with parsing emotes.

0.6

There has only been minor changes between 0.5 and 0.6. Nothing that should break backwards compatibility. Fixes include:

  • Fixed NumberFormatException on modified emotes
    • Twitch changed the emote IDs from always being a number to sometimes being a number_string -.-' Its fixed now
  • Fixed SockerClosedException stacktrace printing on some locales
    • I think I fixed it at least, but this one is hard to test since there are so many locales.
  • Updated the emotes parse for a safer and faster implementation.
    • This deprecates a previously public method (EmoteParse.parseEmote(String, String)), and the new method is package private. There isn't really any need to call these methods from outside the library
  • Twirk will not only show the "User X was not online" or "User X was already online", when in verbose mode.
    • This happened when we see a leave/part message but didn't track the user correctly. I felt like it was not needed unless you want the verbose output
  • Updated the example a bit
  • Started to move towards proper JUnit tests
    • My home rolled test setup wasn't very user friendly, so now I started moving to user regular @Test tests. I'll eventually convert all tests to this format

And probably some more...

Usage

Basic usage

  final Twirk twirk = new TwirkBuilder(channel, SETTINGS.MY_NICK, SETTINGS.MY_PASS).build();
  twirk.connect();
  ...
  twirk.close();

Events

All events which can be reacted to are listed in TwirkListener.java This snippet will make your bot respond to any channel message with a "pong USER_NAME".

  twirk.addIrcListener( new TwirkListener() { 
    public void onPrivMsg( TwitchUser sender, TwitchMessage message) {
      twirk.channelMessage("pong " + sender.getDisplayName() );
    }
  } );

For a more complex example, which shows how to connect properly and how to write simple bot commands, check out the example code in src/example/java

Extendable

You can make Twirk use your own implementation of all event types by using custom builder classes. By extending the types Builder interface, and then passing an instance of your custom builder to the TwirkBuilder, you can use your own custom implementation of whichever type you want.

  final Twirk twirk = new TwirkBuilder(channel, SETTINGS.MY_NICK, SETTINGS.MY_PASS)
    .setClearChatBuilder( new MyClearChatBuilder() )
    .build();

This will make the Twirk instance build instances of your custom implementation of ClearChat events

Known / Verified bot

If your bot requires a very high message rate limit, you can request a verified bot account. It will increase the bots message rate limits: https://dev.twitch.tv/docs/irc/guide#known-and-verified-bots This isn't strictly necessary if you are just making a bot for your own account, as you might not reach the message limits. For larger/more frequently used bots, it might be necessary.

Contribute

If you find any issues, or have suggestions for features (which does not clutter the library), feel free to submit an Issue or make a pull request. You can also reach me on Twitter or on Twitch

License

This library is licensed under the MIT License. If you use it, a link to this GitHub page is also greatly appriciated, if possible :)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].