From 4d8d785dc7113c0c09bf55a4fe5f73df259f1ee6 Mon Sep 17 00:00:00 2001 From: JW Date: Thu, 12 Oct 2023 06:07:05 +0200 Subject: [PATCH] 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 getGifts(); ``` ## LiveClient ### New Methods ```java void connectAsync(Consumer onConnection); CompletableFuture connectAsync(); Logger getLogger(); ``` ## LiveRoomInfo ### New Methods ```java int getViewersCount(); int getLikesCount(); boolean isAgeRestricted(); ``` --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d4bdcb7..c22e4ac 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ Do you prefer other programming languages? com.github.jwdeveloper.TikTok-Live-Java Client - NOT_FOUND + 1.0.0 compile