From 721fa61c4f520f8668ac58b5563d241f644b6ff7 Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 27 Jan 2025 15:08:14 +0300 Subject: [PATCH] Add copyMessage.video_start_timestamp. --- telegram-bot-api/Client.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/telegram-bot-api/Client.cpp b/telegram-bot-api/Client.cpp index 1d1be2c..a21ab6a 100644 --- a/telegram-bot-api/Client.cpp +++ b/telegram-bot-api/Client.cpp @@ -10845,17 +10845,20 @@ td::Status Client::process_copy_message_query(PromisedQueryPtr &query) { if (replace_caption) { TRY_RESULT_ASSIGN(caption, get_caption(query.get())); } + bool replace_video_start_timestamp = query->has_arg("video_start_timestamp"); + int32 new_video_start_timestamp = get_integer_arg(query.get(), "video_start_timestamp", 0); auto show_caption_above_media = to_bool(query->arg("show_caption_above_media")); auto options = make_object(true, replace_caption, std::move(caption), show_caption_above_media); - check_message( - from_chat_id, message_id, false, AccessRights::Read, "message to copy", std::move(query), - [this, options = std::move(options)](int64 from_chat_id, int64 message_id, PromisedQueryPtr query) mutable { - do_send_message( - make_object(from_chat_id, message_id, false, false, 0, std::move(options)), - std::move(query)); - }); + check_message(from_chat_id, message_id, false, AccessRights::Read, "message to copy", std::move(query), + [this, replace_video_start_timestamp, new_video_start_timestamp, options = std::move(options)]( + int64 from_chat_id, int64 message_id, PromisedQueryPtr query) mutable { + do_send_message(make_object( + from_chat_id, message_id, false, replace_video_start_timestamp, + new_video_start_timestamp, std::move(options)), + std::move(query)); + }); return td::Status::OK(); }