mirror of
https://github.com/jwdeveloper/TikTokLiveJava.git
synced 2026-02-27 16:59:39 -05:00
Fix Message parsing for
- LikeMessage - MessageWebcastGiftMessage - MessageWebcastChatMessage
This commit is contained in:
@@ -23,7 +23,7 @@ public class Main {
|
||||
.onEmote(Main::onEmote)
|
||||
.onError(tikTokErrorEvent ->
|
||||
{
|
||||
// tikTokErrorEvent.getException().printStackTrace();
|
||||
// tikTokErrorEvent.getException().printStackTrace();
|
||||
})
|
||||
.buildAndRun();
|
||||
|
||||
@@ -49,8 +49,7 @@ public class Main {
|
||||
}
|
||||
|
||||
private static void onComment(TikTokCommentEvent e) {
|
||||
print("DUPA: "+e.getText());
|
||||
// print(e.getUser().getUniqueId(), e.getText());
|
||||
print(e.getUser().getUniqueId(), e.getText());
|
||||
}
|
||||
|
||||
private static void onFollow(TikTokFollowEvent e) {
|
||||
@@ -83,6 +82,6 @@ public class Main {
|
||||
for (var message : messages) {
|
||||
sb.append(message).append(" ");
|
||||
}
|
||||
System.out.println(sb.toString());
|
||||
System.out.println(sb);
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,14 @@
|
||||
package io.github.jwdeveloper.tiktok;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class SimpleExample {
|
||||
public static void main(String[] args) {
|
||||
public static void main(String[] args) throws IOException {
|
||||
// Username of someone who is currently live
|
||||
var tiktokUsername = "officialgeilegisela";
|
||||
var tiktokUsername = "szwagierkaqueen";
|
||||
|
||||
TikTokLive.newClient(tiktokUsername)
|
||||
.clientSettings(settings ->
|
||||
.configure(settings ->
|
||||
{
|
||||
})
|
||||
.onConnected(event ->
|
||||
@@ -19,12 +21,13 @@ public class SimpleExample {
|
||||
})
|
||||
.onComment(event ->
|
||||
{
|
||||
System.out.println(event.getUser().getUniqueId() + ": " + event.getText());
|
||||
System.out.println(event.getUser().getUniqueId() + ": " + event.getText());
|
||||
})
|
||||
.onError(event ->
|
||||
{
|
||||
event.getException().printStackTrace();
|
||||
})
|
||||
.buildAndRun();
|
||||
System.in.read();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user