From 656152f1f1390bacf60da873e4ae7feafd30039d Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 15 Feb 2024 11:20:57 +0300 Subject: [PATCH] Add Message.reply_to_story. --- telegram-bot-api/Client.cpp | 9 +++++++++ telegram-bot-api/Client.h | 1 + 2 files changed, 10 insertions(+) diff --git a/telegram-bot-api/Client.cpp b/telegram-bot-api/Client.cpp index c719f35..07833f3 100644 --- a/telegram-bot-api/Client.cpp +++ b/telegram-bot-api/Client.cpp @@ -2499,6 +2499,10 @@ void Client::JsonMessage::store(td::JsonValueScope *scope) const { if (message_->reply_to_message != nullptr && message_->reply_to_message->quote_ != nullptr) { object("quote", JsonTextQuote(message_->reply_to_message->quote_.get(), client_)); } + if (message_->reply_to_story != nullptr) { + object("reply_to_story", + JsonStory(message_->reply_to_story->story_sender_chat_id_, message_->reply_to_story->story_id_, client_)); + } if (message_->media_album_id != 0) { object("media_group_id", td::to_string(message_->media_album_id)); } @@ -12899,6 +12903,11 @@ Client::FullMessageId Client::add_message(object_ptr &&message, } else { message_info->reply_to_message = nullptr; } + if (message->reply_to_ != nullptr && message->reply_to_->get_id() == td_api::messageReplyToStory::ID) { + message_info->reply_to_story = move_object_as(message->reply_to_); + } else { + message_info->reply_to_story = nullptr; + } if (message_info->content == nullptr || force_update_content) { message_info->content = std::move(message->content_); diff --git a/telegram-bot-api/Client.h b/telegram-bot-api/Client.h index 0b39eca..25f0cf8 100644 --- a/telegram-bot-api/Client.h +++ b/telegram-bot-api/Client.h @@ -875,6 +875,7 @@ class Client final : public WebhookActor::Callback { object_ptr forward_origin; td::string author_signature; object_ptr reply_to_message; + object_ptr reply_to_story; int64 media_album_id = 0; int64 via_bot_user_id = 0; object_ptr content;