Skip to content

Commit efc6c32

Browse files
committed
Issue #4: No need to check the correctness of the JSON for the commands, the server does it for us and answers false if wrong. Also, commands are generally fixed, so if they worked once they'll continue working, no need for so much checking
1 parent 396037d commit efc6c32

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

src/UniversalTelegramBot.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -360,22 +360,12 @@ bool UniversalTelegramBot::setMyCommands(const String& commandArray) {
360360
return false;
361361
}
362362

363-
DynamicJsonDocument _commandArray(maxMessageLength);
364-
DeserializationError err = deserializeJson(_commandArray, commandArray);
365-
if (err) {
366-
#if defined(_debug)
367-
Serial.println(F("sendSetMyCommands: Deserialization Error"));
368-
Serial.println(commandArray);
369-
#endif // defined(_debug)
370-
return false;
371-
}
372-
373363
DynamicJsonDocument payload(maxMessageLength);
374364
payload["commands"] = serialized(commandArray);
375365
bool sent = false;
376366
String response = "";
377367
#if defined(_debug)
378-
Serial.println(F("sendSetMyCommands: SEND Post /setMyCommands"));
368+
Serial.println(F("sendSetMyCommands: SEND Post /setMyCommands"));
379369
#endif // defined(_debug)
380370
unsigned long sttime = millis();
381371

0 commit comments

Comments
 (0)