after sending 2 or 3 images there is no more img sending.
Maby the telegram api will not accept a lot of images with same name. So i changed the Function
sendPhotoByBinary to generate a random image name witch is sending to telegram api.
Looks like more stable
String UniversalTelegramBot::sendPhotoByBinary(
String chat_id, String contentType, int fileSize,
MoreDataAvailable moreDataAvailableCallback,
GetNextByte getNextByteCallback) {
if (_debug)
Serial.println("SEND Photo");
String name = "img";
name += random(99);
name += ".jpg";
int n = name.length();
char name_array[n + 1];
strcpy(name_array, name.c_str());
String response = sendMultipartFormDataToTelegram(
"sendPhoto", "photo", name_array, contentType, chat_id, fileSize,
moreDataAvailableCallback, getNextByteCallback);
// String response = sendMultipartFormDataToTelegram(
// "sendPhoto", "photo", "img.jpg", contentType, chat_id, fileSize,
// moreDataAvailableCallback, getNextByteCallback);
if (_debug)
Serial.println(response);
return response;
}
Hi,
after sending 2 or 3 images there is no more img sending. Maby the telegram api will not accept a lot of images with same name. So i changed the Function sendPhotoByBinary to generate a random image name witch is sending to telegram api. Looks like more stable
Regards Sven