Skip to content

Commit a0dc655

Browse files
committed
Issue #3: JsonObject not needed in getUpdates()
1 parent f0cd296 commit a0dc655

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/UniversalTelegramBot.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -416,14 +416,13 @@ int UniversalTelegramBot::getUpdates(long offset) {
416416
Serial.println();
417417
#endif
418418

419-
JsonObject obj = doc.as<JsonObject>(); //there is nothing better right now
420419
if (!error) {
421420
#ifdef _debug
422421
Serial.print(F("GetUpdates parsed jsonObj: "));
423-
serializeJson(obj, Serial);
422+
serializeJson(doc, Serial);
424423
Serial.println();
425424
#endif
426-
if (obj.containsKey("result")) {
425+
if (doc.containsKey("result")) {
427426
int resultArrayLength = doc["result"].size();
428427
if (resultArrayLength > 0) {
429428
int newMessageIndex = 0;

0 commit comments

Comments
 (0)