From 98884a5fd58768ca7d8e117b9d6eafb3f766b515 Mon Sep 17 00:00:00 2001 From: Yevhen Vasyliev Date: Wed, 20 Sep 2023 11:15:06 +0300 Subject: [PATCH 1/2] save LongPollBot#ts when calling LongPollBot#initialize --- src/main/java/api/longpoll/bots/LongPollBot.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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(); + } } /** From a1601f1930db426e3f72d2c34d5678f4dd78346e Mon Sep 17 00:00:00 2001 From: Yevhen Vasyliev Date: Wed, 20 Sep 2023 11:16:14 +0300 Subject: [PATCH 2/2] v4.1.7 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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