Skip to content

Commit

Permalink
Merge pull request #176 from yvasyliev/dev
Browse files Browse the repository at this point in the history
Save LongPollBot#ts when calling LongPollBot#initialize
  • Loading branch information
yvasyliev authored Sep 20, 2023
2 parents fe62030 + a1601f1 commit 3429b7a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<groupId>com.github.yvasyliev</groupId>
<artifactId>java-vk-bots-longpoll-api</artifactId>
<packaging>jar</packaging>
<version>4.1.6</version>
<version>4.1.7</version>
<name>Java VK Bots Long Poll API</name>
<description>A Java library to create VK bots using Bots Long Poll API</description>
<url>https://github.com/yvasyliev/java-vk-bots-long-poll-api</url>
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/api/longpoll/bots/LongPollBot.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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();
}
}

/**
Expand Down

0 comments on commit 3429b7a

Please sign in to comment.