mirror of
https://github.com/jwdeveloper/TikTokLiveJava.git
synced 2026-02-28 09:19:40 -05:00
Changes:
Generated new Gifts Json TikTokLive.isLiveOnline() new method for checking if live if online TikTokLive.isLiveOnlineAsync()
This commit is contained in:
@@ -34,6 +34,11 @@ public class CustomGiftExample {
|
||||
|
||||
public static void main(String[] args) {
|
||||
LiveClient client = TikTokLive.newClient(SimpleExample.TIKTOK_HOSTNAME)
|
||||
.onConnected((liveClient, event) ->
|
||||
{
|
||||
liveClient.disconnect();
|
||||
})
|
||||
|
||||
.onGift((liveClient, event) ->
|
||||
{
|
||||
liveClient.getLogger().info(event.getGift().getName());
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
*/
|
||||
package io.github.jwdeveloper.tiktok;
|
||||
|
||||
import io.github.jwdeveloper.tiktok.data.models.Picture;
|
||||
import io.github.jwdeveloper.tiktok.data.models.gifts.Gift;
|
||||
import io.github.jwdeveloper.tiktok.utils.ConsoleColors;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -30,11 +32,20 @@ import java.util.logging.Level;
|
||||
|
||||
public class SimpleExample
|
||||
{
|
||||
public static String TIKTOK_HOSTNAME = "szwagierkaqueen";
|
||||
public static String TIKTOK_HOSTNAME = "seanfitzness";
|
||||
public static void main(String[] args) throws IOException {
|
||||
|
||||
showLogo();
|
||||
// set tiktok username
|
||||
|
||||
/*
|
||||
Optional checking if live is online
|
||||
if(TikTokLive.isLiveOnline(TIKTOK_HOSTNAME))
|
||||
{
|
||||
System.out.println("Live is online!");
|
||||
}
|
||||
*/
|
||||
|
||||
TikTokLive.newClient(SimpleExample.TIKTOK_HOSTNAME)
|
||||
.configure(clientSettings ->
|
||||
{
|
||||
@@ -78,6 +89,14 @@ public class SimpleExample
|
||||
.onDisconnected((liveClient, event) ->
|
||||
{
|
||||
print(ConsoleColors.RED,"[Disconnected]");
|
||||
})
|
||||
.onChestOpen((liveClient, event) ->
|
||||
{
|
||||
print(ConsoleColors.GREEN,"Chest has been open by ",event.getUser().getName());
|
||||
})
|
||||
.onRoom((liveClient, event) ->
|
||||
{
|
||||
|
||||
})
|
||||
.onFollow((liveClient, event) ->
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user