tgbot-cpp icon indicating copy to clipboard operation
tgbot-cpp copied to clipboard

sendPoll and numbering of the options

Open minigo opened this issue 2 years ago • 1 comments

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.

minigo avatar Oct 05 '22 06:10 minigo

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

llnulldisk avatar Oct 05 '22 09:10 llnulldisk