Skip to content

Commit 3429b7a

Browse files
authored
Merge pull request #176 from yvasyliev/dev
Save LongPollBot#ts when calling LongPollBot#initialize
2 parents fe62030 + a1601f1 commit 3429b7a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<groupId>com.github.yvasyliev</groupId>
77
<artifactId>java-vk-bots-longpoll-api</artifactId>
88
<packaging>jar</packaging>
9-
<version>4.1.6</version>
9+
<version>4.1.7</version>
1010
<name>Java VK Bots Long Poll API</name>
1111
<description>A Java library to create VK bots using Bots Long Poll API</description>
1212
<url>https://github.com/yvasyliev/java-vk-bots-long-poll-api</url>

src/main/java/api/longpoll/bots/LongPollBot.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public abstract class LongPollBot extends VkBot {
3232
/**
3333
* Latest received event.
3434
*/
35-
private int ts;
35+
private Integer ts;
3636

3737
/**
3838
* Whether infinite loop should be continued.
@@ -97,7 +97,9 @@ public void initialize() throws VkApiException {
9797

9898
server = longPollServer.get("server").getAsString();
9999
key = longPollServer.get("key").getAsString();
100-
ts = longPollServer.get("ts").getAsInt();
100+
if (ts == null) {
101+
ts = longPollServer.get("ts").getAsInt();
102+
}
101103
}
102104

103105
/**

0 commit comments

Comments
 (0)