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-05 02:25:10 +02:00
parent e76703eae6
commit f55cbcae7e
106 changed files with 75409 additions and 3191 deletions

View File

@@ -22,7 +22,8 @@
*/
package io.github.jwdeveloper.tiktok.exceptions;
import io.github.jwdeveloper.tiktok.messages.WebcastResponse;
import io.github.jwdeveloper.tiktok.messages.webcast.WebcastResponse;
import lombok.Getter;
import java.util.Base64;
@@ -38,19 +39,19 @@ public class TikTokLiveMessageException extends TikTokLiveException {
public TikTokLiveMessageException(WebcastResponse.Message message,
WebcastResponse webcastResponse,
Throwable cause) {
super("Error while handling Message: " + message.getType() + ": \n", cause);
super("Error while handling Message: " + message.getMethod() + ": \n", cause);
this.webcastMessage = message;
this.webcastResponse = webcastResponse;
}
public String messageName()
public String messageMethod()
{
return webcastMessage.getType();
return webcastMessage.getMethod();
}
public String messageToBase64()
{
return Base64.getEncoder().encodeToString(webcastMessage.getBinary().toByteArray());
return Base64.getEncoder().encodeToString(webcastMessage.getPayload().toByteArray());
}
public String webcastResponseToBase64()