Generated new Gifts Json

   TikTokLive.isLiveOnline() new method for checking if live if online
   TikTokLive.isLiveOnlineAsync()
This commit is contained in:
JW
2023-11-10 22:05:01 +01:00
parent 6941107db8
commit 6d268c42f1
53 changed files with 29068 additions and 343 deletions

View File

@@ -29,6 +29,11 @@
<artifactId>jdbi3-core</artifactId>
<version>3.23.0</version>
</dependency>
<dependency>
<groupId>com.googlecode.protobuf-java-format</groupId>
<artifactId>protobuf-java-format</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>org.jdbi</groupId>
<artifactId>jdbi3-sqlobject</artifactId>

View File

@@ -38,39 +38,23 @@ public class RunCollector {
public static void main(String[] args) throws SQLException, IOException {
TikTokMessageCollectorClient.create("giftsCollector")
.addUser("cbcgod")
// .addUser("mr_cios")
.addUser("crece.sara")
.addUser("moniczkka")
// .addUser("cbcgod")
// .addUser("psychotropnazywo")
// .addUser("accordionistka")
.addEventFilter(WebcastGiftMessage.class)
.addOnBuilder(liveClientBuilder ->
{
liveClientBuilder.onGift((liveClient, event) ->
{
});
liveClientBuilder.onGiftCombo((liveClient, event) ->
{
});
liveClientBuilder.onGift((liveClient, event) ->
{
var sb = new StringBuilder();
sb.append("GIFT User: " + event.getUser().getProfileName()+" ");
sb.append("Name: " + event.getGift().name() + " ");
sb.append("Combo: " + event.getCombo() + " ");
System.out.println(sb.toString());
});
liveClientBuilder.onGiftCombo((liveClient, event) ->
{
var gifts = liveClient.getGiftManager().getGifts();
var sb = new StringBuilder();
sb.append("COMBO User: " + event.getUser().getProfileName()+" ");
sb.append("Name: " + event.getGift().name() + " ");
sb.append("GIFT User: " + event.getUser().getProfileName()+" ");
sb.append("Name: " + event.getGift().getName() + " ");
sb.append("Combo: " + event.getCombo() + " ");
sb.append("Type: " + event.getComboState().name());
System.out.println(sb.toString());
});
})
@@ -78,6 +62,7 @@ public class RunCollector {
System.in.read();
}
}

View File

@@ -37,6 +37,7 @@ public class MessageUtil
var deserialized = parseMethod.invoke(null, message.getPayload());
return JsonUtil.messageToJson(deserialized);
} catch (Exception ex) {
return ConsoleColors.RED+ "Can not find mapper for "+message.getMethod();
}
}
@@ -48,8 +49,13 @@ public class MessageUtil
var parseMethod = inputClazz.getDeclaredMethod("parseFrom", byte[].class);
var deserialized = parseMethod.invoke(null, bytes);
return JsonUtil.messageToJson(deserialized);
} catch (Exception ex) {
return ConsoleColors.RED+ "Can not find mapper for "+methodName;
} catch (Exception ex)
{
var sb = new StringBuilder();
sb.append("Can not find mapper for "+methodName);
sb.append("\n");
//String jsonString = JsonFormat.printToString(protobufData);
return sb.toString();
}
}

File diff suppressed because one or more lines are too long