From 1270c704994eeabe68ffcce194b7021035157eeb Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 31 Oct 2022 15:36:42 +0300 Subject: [PATCH] Add Chat.is_forum. --- telegram-bot-api/Client.cpp | 4 ++++ telegram-bot-api/Client.h | 1 + 2 files changed, 5 insertions(+) diff --git a/telegram-bot-api/Client.cpp b/telegram-bot-api/Client.cpp index d22bb98..e9d2d64 100644 --- a/telegram-bot-api/Client.cpp +++ b/telegram-bot-api/Client.cpp @@ -710,6 +710,9 @@ class Client::JsonChat final : public Jsonable { if (!supergroup_info->active_usernames.empty()) { object("username", supergroup_info->active_usernames[0]); } + if (supergroup_info->is_supergroup && supergroup_info->is_forum) { + object("is_forum", td::JsonTrue()); + } if (supergroup_info->is_supergroup) { object("type", "supergroup"); @@ -9253,6 +9256,7 @@ void Client::add_supergroup(SupergroupInfo *supergroup_info, object_ptrdate = supergroup->date_; supergroup_info->status = std::move(supergroup->status_); supergroup_info->is_supergroup = !supergroup->is_channel_; + supergroup_info->is_forum = supergroup->is_forum_; supergroup_info->has_location = supergroup->has_location_; supergroup_info->join_to_send_messages = supergroup->join_to_send_messages_; supergroup_info->join_by_request = supergroup->join_by_request_; diff --git a/telegram-bot-api/Client.h b/telegram-bot-api/Client.h index caeb0d3..9b040cb 100644 --- a/telegram-bot-api/Client.h +++ b/telegram-bot-api/Client.h @@ -683,6 +683,7 @@ class Client final : public WebhookActor::Callback { object_ptr location; object_ptr status; bool is_supergroup = false; + bool is_forum = false; bool can_set_sticker_set = false; bool has_location = false; bool join_to_send_messages = false;