Skip to content

Commit fac27fe

Browse files
authored
Update UniversalTelegramBot.cpp
On the Arduino Uno (and other ATmega based boards) an int stores a 16-bit (2-byte) value. On the Arduino Due and SAMD based boards (like MKR1000 and Zero), an int stores a 32-bit (4-byte) value. This is a better type, as the first thing update_id is compared with, is another long "last_message_received". it will fix the multiple issues raised for low resource boards.
1 parent a1952c4 commit fac27fe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/UniversalTelegramBot.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ int UniversalTelegramBot::getUpdates(long offset) {
436436
}
437437

438438
bool UniversalTelegramBot::processResult(JsonObject result, int messageIndex) {
439-
int update_id = result["update_id"];
439+
long update_id = result["update_id"];
440440
// Check have we already dealt with this message (this shouldn't happen!)
441441
if (last_message_received != update_id) {
442442
last_message_received = update_id;

0 commit comments

Comments
 (0)