Modersi / TelegramBotAPI

Telegram Bot API on C++ and Qt
MIT License
34 stars 19 forks source link

Telegram::Bot::sendMediaGroup is broken #16

Open kleuter opened 5 months ago

kleuter commented 5 months ago

Error 400 (Bad Request: can't parse InputMedia: media not found)

Simple example:

auto photo_file = std::make_shared<QFile>("D:/1.png");
auto photo_file2 = std::make_shared<QFile>("D:/2.png");

bool bOk1 = photo_file->open(QIODevice::ReadOnly);
bool bOk2 = photo_file2->open(QIODevice::ReadOnly);

Q_ASSERT(bOk1 && bOk2);

_bot->sendMediaGroup(chat_id,
    { InputMediaPhoto(photo_file.get()), InputMediaPhoto(photo_file2.get()) },
    {  }
).get();