From af209fc2ca55f5561533a9ff16e9a09f9de36967 Mon Sep 17 00:00:00 2001 From: JW Date: Tue, 22 Aug 2023 21:00:16 +0200 Subject: [PATCH] Update README.md --- README.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/README.md b/README.md index 69c1351..9eccfbc 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,39 @@ Do you prefer other programming languages? .buildAndRun(); } ``` +## Configuration + +```java +package io.github.jwdeveloper.tiktok; + +import java.io.IOException; +import java.time.Duration; +import java.util.logging.Level; + +public class ConfigurationExample +{ + public static void main(String[] args) throws IOException { + + TikTokLive.newClient(Main.TEST_TIKTOK_USER) + .configure(clientSettings -> + { + clientSettings.setHostName(Main.TEST_TIKTOK_USER); //tiktok user + clientSettings.setClientLanguage("en"); //language + clientSettings.setTimeout(Duration.ofSeconds(2)); //connection timeout + clientSettings.setLogLevel(Level.ALL); //log level + clientSettings.setDownloadGiftInfo(true); //TODO + clientSettings.setCheckForUnparsedData(true); //TODO + clientSettings.setPollingInterval(Duration.ofSeconds(1)); //TODO + clientSettings.setPrintMessageData(true); //TODO + clientSettings.setPrintToConsole(true); //TODO + clientSettings.setHandleExistingMessagesOnConnect(true); //TODO + clientSettings.setRetryOnConnectionFailure(true); //TODO + }) + .buildAndRun(); + } +} + +``` ## Methods A `TikTokLive` object contains the following methods.