some refactoring
This commit is contained in:
@@ -117,7 +117,6 @@ public class OkHttpTelegramBot implements TelegramBot {
|
||||
enableHandlers = builder.enableHandlers;
|
||||
userStateStorage = builder.userStateStorage;
|
||||
userState = builder.userState;
|
||||
if (builder.updateConsumer != null) setUpdateConsumer(builder.updateConsumer);
|
||||
/*
|
||||
if (false) {
|
||||
Class<? extends UpdateConsumer> updateConsumerClass = builder.updateConsumer == null ? UpdateConsumer.class : builder.updateConsumer.getClass();
|
||||
@@ -129,6 +128,7 @@ public class OkHttpTelegramBot implements TelegramBot {
|
||||
*/
|
||||
this.TELEGRAM_API_URL = "https://api.telegram.org/bot" + builder.token + "/";
|
||||
this.TELEGRAM_FILE_API_URL = "https://api.telegram.org/file/bot" + builder.token + "/";
|
||||
if (builder.updateConsumer != null) setUpdateConsumer(builder.updateConsumer);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -195,7 +195,7 @@ public class OkHttpTelegramBot implements TelegramBot {
|
||||
});
|
||||
}
|
||||
}
|
||||
if (updateConsumer != null) CompletableFuture.runAsync(() -> updateConsumer.getUpdates(updates));
|
||||
if (updateConsumer != null) CompletableFuture.runAsync(() -> updateConsumer.onUpdates(updates));
|
||||
} finally {
|
||||
lastUpdateId.set(updates.getLast().updateId());
|
||||
if (!thread.isShutdown()) getUpdates();
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
module longpolling.okhttp {
|
||||
exports hdvtdev.telegram.longpolling.okhttp;
|
||||
requires com.fasterxml.jackson.databind;
|
||||
requires com.fasterxml.jackson.core;
|
||||
requires core;
|
||||
requires okhttp3;
|
||||
requires com.fasterxml.jackson.databind;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user