Commit 4d8d785
committed
1.0.0 MAJOR update
# 1.0.0 Update
Official version of Tiktok live Java. Code has been restructure, improve and renamed to make
using simpler and more intuitive, since that library is no longer compatable with longer versions.
# Breaking changes:
## Configuration
- `clientSettings.setHandleExistingMessagesOnConnect(true)` Renamed to `setHandleExistingEvents()`
- `clientSettings.setDownloadGiftInfo(true);` Removed
- `clientSettings.setPrintMessageData(false);` Removed
## Events
### Added
- `onGiftCombo`
onGiftComboevent is invoked for all give events, it contains 3 combo stages
I would suggest to use it for somekind of visualizations
* `GiftSendType.Begin`
* `GiftSendType.Active`
* `GiftSendType.Finished`
- `onWebsocketResponse`
- `onRoomUserInfo`
- `onRoom`
- `onQuestion`
### Changed
- `onComment`
- `onGiftMessage -> onGift`
OnGift event is now invoked only when combo has been finished of gift is not strakeable (exprensive)
- `onRoomMessage -> onRoom`
### Removed
I wasn't sure if those events are working, so I decided to remove them for now
but they will be gradually added again with next updates
- `onLinkMicFanTicket`
- `onEnvelope`
- `onShop`
- `onDetect`
- `onLinkLayer`
- `onCaption`
- `onRoomPin`
- `onBarrage`
- `onLinkMicArmies`
- `onUnauthorizedMember`
- `onInRoomBanner`
- `onLinkMicMethod`
- `onPoll`
- `onGoalUpdate`
- `onRankUpdate`
- `onIMDelete`
- `onRankText`
- `onUnhandledMember`
- `onSubNotify`
- `onLinkMicBattle`
- `onUnhandledControl`
## Gifts
`Gitf` has been changed from `class` to `enum` that allows to simple use by checking avaliable values
and using `switch expression`
### Example
```java
Gift gift = Gift.GIFT_BOX;
switch (gift) {
case ROSE -> print(ConsoleColors.RED, "Rose!");
case GG -> print(ConsoleColors.YELLOW, " GOOD GAME!");
case TIKTOK -> print(ConsoleColors.CYAN,"Thanks for TikTok");
default -> print(ConsoleColors.GREEN, "[Thanks for gift] ", ConsoleColors.YELLOW, event.getGift().getName(), "x", event.getCombo());
}
```
## GiftManager
### New Methods
```java
Gift registerGift(int id, String name, int diamondCost, Picture picture);
Gift findById(int giftId);
Gift findByName(String giftName);
List<Gift> getGifts();
```
## LiveClient
### New Methods
```java
void connectAsync(Consumer<LiveClient> onConnection);
CompletableFuture<LiveClient> connectAsync();
Logger getLogger();
```
## LiveRoomInfo
### New Methods
```java
int getViewersCount();
int getLikesCount();
boolean isAgeRestricted();
```1 parent d8b75af commit 4d8d785
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| |||
0 commit comments