mirror of
https://github.com/jwdeveloper/TikTokLiveJava.git
synced 2026-02-27 16:59:39 -05:00
- Implementation on all features in `clientSettings` - Code optimization - More detail exceptions - Downloading gifts
33 lines
1.1 KiB
Java
33 lines
1.1 KiB
Java
package io.github.jwdeveloper.tiktok;
|
|
|
|
import java.io.IOException;
|
|
|
|
public class SimpleExample {
|
|
public static void main(String[] args) throws IOException {
|
|
|
|
TikTokLive.newClient(Main.TEST_TIKTOK_USER)
|
|
.onConnected((client, event) ->
|
|
{
|
|
System.out.println("Connected");
|
|
})
|
|
.onJoin((client, event) ->
|
|
{
|
|
System.out.println("User joined -> " + event.getUser().getNickName());
|
|
})
|
|
.onComment((client, event) ->
|
|
{
|
|
System.out.println(event.getUser().getUniqueId() + ": " + event.getText());
|
|
})
|
|
.onEvent((client, event) ->
|
|
{
|
|
System.out.println("Viewers count: "+client.getRoomInfo().getViewersCount());
|
|
})
|
|
.onError((client, event) ->
|
|
{
|
|
event.getException().printStackTrace();
|
|
})
|
|
.buildAndRun();
|
|
System.in.read();
|
|
}
|
|
}
|