https://github.com/iprodigy/bttv4j
https://github.com/iprodigy/bttv4j
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/iprodigy/bttv4j
- Owner: iProdigy
- License: mpl-2.0
- Created: 2025-04-03T05:35:06.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-05T18:25:38.000Z (about 1 year ago)
- Last Synced: 2025-04-05T19:27:03.720Z (about 1 year ago)
- Language: Java
- Size: 80.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.