diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index f8ac96b72..b98c89169 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -1566,8 +1566,8 @@ inputMessageGame bot_user_id:int32 game_short_name:string = InputMessageContent; 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 secret chats. Polls can be sent only to a private chat with a bot @question Poll question, 1-255 characters @options List of poll answer options, 2-10 strings 1-100 characters each -//@is_anonymous True, if the poll voters are anonymous. Non-anonymous polls can't be sent or forwarded to channels @type Type of the poll -inputMessagePoll question:string options:vector is_anonymous:Bool type:PollType = InputMessageContent; +//@is_anonymous True, if the poll voters are anonymous. Non-anonymous polls can't be sent or forwarded to channels @type Type of the poll @is_closed True, if the poll needs to be sent already closed; for bots only +inputMessagePoll question:string options:vector is_anonymous:Bool type:PollType is_closed:Bool = 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/generate/scheme/td_api.tlo b/td/generate/scheme/td_api.tlo index 87956b8a7..3f14d9d0d 100644 Binary files a/td/generate/scheme/td_api.tlo and b/td/generate/scheme/td_api.tlo differ diff --git a/td/telegram/MessageContent.cpp b/td/telegram/MessageContent.cpp index 993b58837..db8324ffe 100644 --- a/td/telegram/MessageContent.cpp +++ b/td/telegram/MessageContent.cpp @@ -1833,7 +1833,7 @@ static Result create_input_message_content( content = make_unique(td->poll_manager_->create_poll( std::move(input_poll->question_), std::move(input_poll->options_), input_poll->is_anonymous_, - allow_multiple_answers, is_quiz, correct_option_id, false)); + allow_multiple_answers, is_quiz, correct_option_id, input_poll->is_closed_)); break; } default: diff --git a/td/telegram/PollManager.cpp b/td/telegram/PollManager.cpp index 26f6bf852..544e3d861 100644 --- a/td/telegram/PollManager.cpp +++ b/td/telegram/PollManager.cpp @@ -1139,6 +1139,9 @@ tl_object_ptr PollManager::get_input_media(PollId poll if (poll->is_quiz) { poll_flags |= telegram_api::poll::QUIZ_MASK; } + if (poll->is_closed) { + poll_flags |= telegram_api::poll::CLOSED_MASK; + } int32 flags = 0; vector correct_answers; diff --git a/td/telegram/cli.cpp b/td/telegram/cli.cpp index db59ef791..9f5f0f22e 100644 --- a/td/telegram/cli.cpp +++ b/td/telegram/cli.cpp @@ -3208,7 +3208,7 @@ class CliClient final : public Actor { poll_type = td_api::make_object(op == "spollm"); } send_message(chat_id, td_api::make_object(question, std::move(options), op != "spollp", - std::move(poll_type))); + std::move(poll_type), false)); } else if (op == "sp" || op == "spcaption" || op == "spttl") { string chat_id; string photo_path;