From 325dc5d2934920328f6cf8a3af8c05ed627f7cdd Mon Sep 17 00:00:00 2001 From: levlam Date: Tue, 21 May 2024 12:39:13 +0300 Subject: [PATCH] Support expandable_blockquote entities. --- telegram-bot-api/Client.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/telegram-bot-api/Client.cpp b/telegram-bot-api/Client.cpp index 81fe4f0..83a7f16 100644 --- a/telegram-bot-api/Client.cpp +++ b/telegram-bot-api/Client.cpp @@ -523,6 +523,9 @@ class Client::JsonEntity final : public td::Jsonable { case td_api::textEntityTypeBlockQuote::ID: object("type", "blockquote"); break; + case td_api::textEntityTypeExpandableBlockQuote::ID: + object("type", "expandable_blockquote"); + break; default: UNREACHABLE(); } @@ -542,8 +545,7 @@ class Client::JsonVectorEntities final : public td::Jsonable { auto array = scope->enter_array(); for (auto &entity : entities_) { auto entity_type = entity->type_->get_id(); - if (entity_type != td_api::textEntityTypeExpandableBlockQuote::ID && - entity_type != td_api::textEntityTypeBankCardNumber::ID && + if (entity_type != td_api::textEntityTypeBankCardNumber::ID && entity_type != td_api::textEntityTypeMediaTimestamp::ID) { array << JsonEntity(entity.get(), client_); } @@ -8792,6 +8794,9 @@ td::Result> Client::get_text_entity_t if (type == "blockquote") { return make_object(); } + if (type == "expandable_blockquote") { + return make_object(); + } if (type == "mention" || type == "hashtag" || type == "cashtag" || type == "bot_command" || type == "url" || type == "email" || type == "phone_number" || type == "bank_card_number") { return nullptr;