Changes:
Http-client settings in configure method
```
TikTokLive.newClient("X")
.configure(liveClientSettings ->
{
var httpSetting = liveClientSettings.getHttpSettings();
httpSetting.setTimeout(Duration.ofSeconds(12));
});
```
`TikTokLive.requests()` Easy and quick way of making
http request to tiktok
```
var giftsResponse =TikTokLive.request.fetchGiftsData();
```
Removed:
TikTokLive.isLiveOnline(String hostName);
TikTokLive.isHostNameValidAsync(String hostName);
instead you can use
```
TikTokLive.requests().fetchLiveUserData("Mike").getUserStatus()
```
New Events
- onLiveUnpaused()
- onRoomInfo() triggered when LiveRoomInfo got updated
Removed:
- clientSettings.setHandleExistingEvents
- onRoom Replaced with onRoomInfo event
- onRoomUserInfo Replaced with onRoomInfo event
Gifts:
- onGift event was not triggered for the more expensive gifts
- onGiftCombo with more expensive gifts was stuck in the GiftSendType.Begin state
Fixed:
- setPrintToConsole(false) was not disabling logs
# 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();
```
- addListeners() was throwing exception
- 404 response code was return while connecting to tiktok for some users
- configure.setRoomId() method for people that want to set roomId manually
- client.roomInfo().isAgeRestricted() check if live has age restriction