reo7sp / tgbot-cpp

C++ library for Telegram bot API
http://reo7sp.github.io/tgbot-cpp
MIT License
1.01k stars 246 forks source link

sendPoll and numbering of the options #234

Open minigo opened 2 years ago

minigo commented 2 years ago

Code: std::vector<std::string> options = {"1","2","3","4"}; bot.getApi ().sendPoll (message->chat->id, "Answers", options, false, 0, std::make_shared<TgBot::GenericReply> (), true, "quiz", false, correct_answer, explanation);

If i set the correct correct_answer value to 0 or 4 i get an error - error: Bad Request: wrong correct option ID specified.

llnulldisk commented 2 years ago

Thanks! If you set the value to 4, an error should appear, because you don't have 5 options