mirror of
https://github.com/jwdeveloper/TikTokLiveJava.git
synced 2026-02-28 09:19:40 -05:00
made: settings.fetchGifts default to true,
attach to options `setOffline` create static method `of` for events -TikTokGiftEvent -TikTokCommentEvent -TikTokSubscribeEvent -TikTokFollowEvent -TikTokLikeEvent -TikTokJoinEvent Rename: GiftSendType -> GiftComboStateType
This commit is contained in:
@@ -3,15 +3,16 @@ package io.github.jwdeveloper.tiktok;
|
||||
import io.github.jwdeveloper.tiktok.data.events.TikTokCommentEvent;
|
||||
import io.github.jwdeveloper.tiktok.data.events.TikTokSubNotifyEvent;
|
||||
import io.github.jwdeveloper.tiktok.data.events.TikTokSubscribeEvent;
|
||||
import io.github.jwdeveloper.tiktok.data.events.gift.TikTokGiftComboEvent;
|
||||
import io.github.jwdeveloper.tiktok.data.events.gift.TikTokGiftEvent;
|
||||
import io.github.jwdeveloper.tiktok.data.events.social.TikTokFollowEvent;
|
||||
import io.github.jwdeveloper.tiktok.data.events.social.TikTokJoinEvent;
|
||||
import io.github.jwdeveloper.tiktok.data.events.social.TikTokLikeEvent;
|
||||
import io.github.jwdeveloper.tiktok.data.models.gifts.GiftComboStateType;
|
||||
import io.github.jwdeveloper.tiktok.live.LiveClient;
|
||||
|
||||
public class Events_And_Gifts_Testing_Example {
|
||||
public static void main(String[] args)
|
||||
{
|
||||
public static void main(String[] args) {
|
||||
LiveClient client = TikTokLive.newClient(ConnectionExample.TIKTOK_HOSTNAME)
|
||||
.configure(liveClientSettings ->
|
||||
{
|
||||
@@ -28,17 +29,19 @@ public class Events_And_Gifts_Testing_Example {
|
||||
})
|
||||
.onGiftCombo((liveClient, event) ->
|
||||
{
|
||||
liveClient.getLogger().info("Connected");
|
||||
liveClient.getLogger().info("New fake combo Gift: " + event.getGift());
|
||||
})
|
||||
.onGift((liveClient, event) ->
|
||||
{
|
||||
liveClient.getLogger().info("New fakeGift: " + event.getGift());
|
||||
liveClient.getLogger().info("New fake Gift: " + event.getGift());
|
||||
})
|
||||
.buildAndConnect();
|
||||
.build();
|
||||
|
||||
var gifts = TikTokLive.gifts();
|
||||
var fakeGift = TikTokGiftEvent.of(gifts.getByName("Rose"));
|
||||
fakeGift = TikTokGiftEvent.of("Rose", 1, 23);
|
||||
var roseGift = gifts.getByName("Rose");
|
||||
|
||||
var fakeGift = TikTokGiftEvent.of(roseGift);
|
||||
var fakeComboGift = TikTokGiftComboEvent.of(roseGift, 12, GiftComboStateType.Begin);
|
||||
|
||||
var fakeMessage = TikTokCommentEvent.of("Mark", "Hello world");
|
||||
|
||||
@@ -47,8 +50,10 @@ public class Events_And_Gifts_Testing_Example {
|
||||
var fakeLike = TikTokLikeEvent.of("Mark", 12);
|
||||
var fakeJoin = TikTokJoinEvent.of("Mark");
|
||||
|
||||
client.connect();
|
||||
|
||||
client.publishEvent(fakeGift);
|
||||
client.publishEvent(fakeComboGift);
|
||||
client.publishEvent(fakeMessage);
|
||||
client.publishEvent(fakeSubscriber);
|
||||
client.publishEvent(fakeFollow);
|
||||
@@ -59,10 +64,4 @@ public class Events_And_Gifts_Testing_Example {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void GetBuilder() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user