From aa737b3dcff87fbe69a0b72d2738a13c04fa825f Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 8 Apr 2021 17:49:53 +0300 Subject: [PATCH] Support messageVoiceChatScheduled. --- telegram-bot-api/Client.cpp | 20 ++++++++++++++++++++ telegram-bot-api/Client.h | 1 + 2 files changed, 21 insertions(+) diff --git a/telegram-bot-api/Client.cpp b/telegram-bot-api/Client.cpp index d3b4c39..04109e6 100644 --- a/telegram-bot-api/Client.cpp +++ b/telegram-bot-api/Client.cpp @@ -1400,6 +1400,20 @@ class Client::JsonProximityAlertTriggered : public Jsonable { const Client *client_; }; +class Client::JsonVoiceChatScheduled : public Jsonable { + public: + explicit JsonVoiceChatScheduled(const td_api::messageVoiceChatScheduled *voice_chat_scheduled) + : voice_chat_scheduled_(voice_chat_scheduled) { + } + void store(JsonValueScope *scope) const { + auto object = scope->enter_object(); + object("start_date", voice_chat_scheduled_->start_date_); + } + + private: + const td_api::messageVoiceChatScheduled *voice_chat_scheduled_; +}; + class Client::JsonVoiceChatStarted : public Jsonable { public: explicit JsonVoiceChatStarted(const td_api::messageVoiceChatStarted *voice_chat_started) @@ -1836,6 +1850,11 @@ void Client::JsonMessage::store(JsonValueScope *scope) const { object("proximity_alert_triggered", JsonProximityAlertTriggered(content, client_)); break; } + case td_api::messageVoiceChatScheduled::ID: { + auto content = static_cast(message_->content.get()); + object("voice_chat_scheduled", JsonVoiceChatScheduled(content)); + break; + } case td_api::messageVoiceChatStarted::ID: { auto content = static_cast(message_->content.get()); object("voice_chat_started", JsonVoiceChatStarted(content)); @@ -8638,6 +8657,7 @@ bool Client::need_skip_update_message(int64 chat_id, const object_ptr