diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 3b1c832c..9d6b1d2b 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -1415,7 +1415,7 @@ inputMessageGame bot_user_id:int32 game_short_name:string = InputMessageContent; //@payload The invoice payload @provider_token Payment provider token @provider_data JSON-encoded data about the invoice, which will be shared with the payment provider @start_parameter Unique invoice bot start_parameter for the generation of this invoice inputMessageInvoice invoice:invoice title:string description:string photo_url:string photo_size:int32 photo_width:int32 photo_height:int32 payload:bytes provider_token:string provider_data:string start_parameter:string = InputMessageContent; -//@description A message with a poll. Polls can't be sent to private or secret chats @question Poll question, 1-255 characters @options List of poll answer options, 1-10 strings 1-100 characters each +//@description A message with a poll. Polls can't be sent to private or secret chats @question Poll question, 1-255 characters @options List of poll answer options, 2-10 strings 1-100 characters each inputMessagePoll question:string options:vector = InputMessageContent; //@description A forwarded message @from_chat_id Identifier for the chat this forwarded message came from @message_id Identifier of the message to forward @in_game_share True, if a game message should be shared within a launched game; applies only to game messages diff --git a/td/telegram/MessageContent.cpp b/td/telegram/MessageContent.cpp index 7fd3b551..85e272f6 100644 --- a/td/telegram/MessageContent.cpp +++ b/td/telegram/MessageContent.cpp @@ -1759,8 +1759,8 @@ static Result create_input_message_content( if (input_poll->question_.size() > MAX_POLL_QUESTION_LENGTH) { return Status::Error(400, PSLICE() << "Poll question length must not exceed " << MAX_POLL_QUESTION_LENGTH); } - if (input_poll->options_.empty()) { - return Status::Error(400, "Poll must have at least 1 option"); + if (input_poll->options_.size() <= 1) { + return Status::Error(400, "Poll must have at least 2 option"); } if (input_poll->options_.size() > MAX_POLL_OPTIONS) { return Status::Error(400, PSLICE() << "Poll can't have more than " << MAX_POLL_OPTIONS << " options");