Breaking changes:

'Gift': changed from class to enum, so now you can handle
incoming gifts in switch

`Events`
- new:
     onGiftComboFinished
- Removed:
      onGiftBrodcast
- Rename:
     onGiftMessage -> onGift
     onRoomPinMessage -> onRoomPin
     onRoomMessage -> onRoom
     onLinkMessage -> onLink
     onBarrageMessage -> onBarrage
     onPollMessage -> onPoll
     onShopMessage -> onShop
     onDetectMessage -> onDetect

`GiftManager`
   added:
      registerGift
      findById
      findByName
      getGifts
   removed:
      getActiveGifts
This commit is contained in:
JW
2023-10-12 05:28:06 +02:00
parent bac4389823
commit 7621e32141
22 changed files with 317 additions and 99 deletions

View File

@@ -34,7 +34,9 @@ import io.github.jwdeveloper.tiktok.utils.ConsoleColors;
import java.io.IOException;
public class ListenerExample {
public class ListenerExample
{
// <code>
/**
*
* Listeners are an alternative way of handling events.
@@ -84,7 +86,7 @@ public class ListenerExample {
public void onGift(LiveClient liveClient, TikTokGiftEvent event) {
var message = switch (event.getGift()) {
case ROSE -> "Thanks :)";
case APPETIZERS -> ":$";
case APPETIZERS -> ":OO";
case APRIL -> ":D";
case TIKTOK -> ":P";
case CAP -> ":F";
@@ -100,6 +102,7 @@ public class ListenerExample {
}
// </code>
private static void showLogo()
{
System.out.println(ConsoleColors.GREEN+"""