From 02c9a6975e3a4808d22671304bafc3670076c654 Mon Sep 17 00:00:00 2001 From: levlam Date: Fri, 24 Jan 2025 18:12:26 +0300 Subject: [PATCH] Add ChatFullInfo.can_send_gift. --- telegram-bot-api/Client.cpp | 7 +++++++ telegram-bot-api/Client.h | 1 + 2 files changed, 8 insertions(+) diff --git a/telegram-bot-api/Client.cpp b/telegram-bot-api/Client.cpp index 82abc45..8c7e456 100644 --- a/telegram-bot-api/Client.cpp +++ b/telegram-bot-api/Client.cpp @@ -976,6 +976,9 @@ class Client::JsonChat final : public td::Jsonable { } object("type", "private"); if (is_full_) { + if (user_info->type == UserInfo::Type::Regular) { + object("can_send_gift", td::JsonTrue()); + } if (!user_info->active_usernames.empty()) { object("active_usernames", td::json_array(user_info->active_usernames, [](td::Slice username) { return td::JsonString(username); })); @@ -1082,6 +1085,9 @@ class Client::JsonChat final : public td::Jsonable { LOG(ERROR) << "Not found chat custom emoji sticker set " << supergroup_info->custom_emoji_sticker_set_id; } } + if (supergroup_info->can_send_gift) { + object("can_send_gift", td::JsonTrue()); + } if (supergroup_info->can_set_sticker_set) { object("can_set_sticker_set", td::JsonTrue()); } @@ -7418,6 +7424,7 @@ void Client::on_update(object_ptr result) { supergroup_info->sticker_set_id = full_info->sticker_set_id_; supergroup_info->custom_emoji_sticker_set_id = full_info->custom_emoji_sticker_set_id_; supergroup_info->can_set_sticker_set = full_info->can_set_sticker_set_; + supergroup_info->can_send_gift = full_info->can_send_gift_; supergroup_info->is_all_history_available = full_info->is_all_history_available_; supergroup_info->slow_mode_delay = full_info->slow_mode_delay_; supergroup_info->unrestrict_boost_count = full_info->unrestrict_boost_count_; diff --git a/telegram-bot-api/Client.h b/telegram-bot-api/Client.h index 58ddd4a..f691562 100644 --- a/telegram-bot-api/Client.h +++ b/telegram-bot-api/Client.h @@ -909,6 +909,7 @@ class Client final : public WebhookActor::Callback { bool is_supergroup = false; bool is_forum = false; bool can_set_sticker_set = false; + bool can_send_gift = false; bool is_all_history_available = false; bool has_location = false; bool join_to_send_messages = false;