An open API service indexing awesome lists of open source software.

https://github.com/iprodigy/bttv4j


https://github.com/iprodigy/bttv4j

Last synced: about 1 year ago
JSON representation

Awesome Lists containing this project

README

          

# BTTV4J

Modular Java wrapper for [BetterTTV](https://betterttv.com/)'s [REST API](https://betterttv.com/developers/api) and [WebSocket](https://betterttv.com/developers/websocket) interface.

## REST API

```java
BetterTTV api = BttvApiFactory.build();

// Obtain the global emotes
Collection emotes = api.getGlobalEmotes();

// Query the emotes for a given channel
User user = api.getUser(Provider.TWITCH, "11785491");

// Query which users have BTTV badges for a given platform
Collection badges = api.getBadges(Provider.TWITCH);
```

## WebSocket

```java
// Establish websocket connection
BttvSocket ws = new BttvSocket();

// Prepare event handlers
ws.getEventManager().onEvent(EmoteCreateEvent.class, System.out::println);
ws.getEventManager().onEvent(EmoteUpdateEvent.class, System.out::println);
ws.getEventManager().onEvent(EmoteDeleteEvent.class, System.out::println);
ws.getEventManager().onEvent(UserUpdateEvent.class, System.out::println);

// Join channels
String channelId = "53888434", userId = "149223493";
ws.joinChannel(Provider.TWITCH, channelId);
ws.broadcastMe(Provider.TWITCH, channelId, userId);
```

## Notice

This project is not affiliated, associated, authorized, endorsed by, or in any way officially connected with BetterTTV or NightDev, LLC. or Twitch Interactive.

All trademarks are property of their respective owners, and this project does not grant any rights to any trademarks.