@BotHandler(token = "token", id = 12345) // Token and ID for init botclient
public class BotClientTest extends BotClient{
private static final BotClientTest bot = newLocalExec(BotClientTest::new, true); // initialize bootstrap
public BotClientTest() {
// empty constructor, flag for compiler
}
@Override
public void onStart() {
debug(true); // debug mode, for expand information when program works
systemLocale("ru"); // localization for activate autotranslate cluster
getInstaller().installHandler(new CommandDispatch()); // Init program
}
@AsyncInit(asyncId = 1)
public static class CommandDispatch implements VkCommandExecutor {
@Override
public void onCommand(@NotNull IBotUtils bot, @NotNull VkApiClient client, @NotNull GroupActor actor,
@NotNull Message message, @NotNull String[] args) {
// TODO: Works code there, when user send command in VK chat to bot
}
}
}
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependency>
<groupId>com.github.MrHaber</groupId>
<artifactId>BotClient_Pre-Realise</artifactId>
<version>version_from_github</version>
</dependency>
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.MrHaber:BotClient_Pre-Realise:version_from_github'
}
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.11.2</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.11.2</version>
</dependency>
dependencies {
//Binding for Log4J -->
compile group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '2.11.2'
//Log4j API and Core implementation required for binding
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.11.2'
compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.11.2'
}
After all, go to main class and setting up logger level for HttpTransportClient
Configurator.setLevel("com.vk.api.sdk.httpclient.HttpTransportClient",Level.WARN);