diff --git a/pom.xml b/pom.xml index e7b07345..83b51bc4 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.github.yvasyliev java-vk-bots-longpoll-api jar - 4.1.6 + 4.1.7 Java VK Bots Long Poll API A Java library to create VK bots using Bots Long Poll API https://github.com/yvasyliev/java-vk-bots-long-poll-api diff --git a/src/main/java/api/longpoll/bots/LongPollBot.java b/src/main/java/api/longpoll/bots/LongPollBot.java index b0416cf8..d4ff5f55 100644 --- a/src/main/java/api/longpoll/bots/LongPollBot.java +++ b/src/main/java/api/longpoll/bots/LongPollBot.java @@ -32,7 +32,7 @@ public abstract class LongPollBot extends VkBot { /** * Latest received event. */ - private int ts; + private Integer ts; /** * Whether infinite loop should be continued. @@ -97,7 +97,9 @@ public void initialize() throws VkApiException { server = longPollServer.get("server").getAsString(); key = longPollServer.get("key").getAsString(); - ts = longPollServer.get("ts").getAsInt(); + if (ts == null) { + ts = longPollServer.get("ts").getAsInt(); + } } /**