diff options
-rw-r--r-- | include/tgbot/types/Message.h | 23 | ||||
-rw-r--r-- | src/TgTypeParser.cpp | 8 |
2 files changed, 31 insertions, 0 deletions
diff --git a/include/tgbot/types/Message.h b/include/tgbot/types/Message.h index daedf03..ea53cf3 100644 --- a/include/tgbot/types/Message.h +++ b/include/tgbot/types/Message.h @@ -114,6 +114,8 @@ public: */ Video::Ptr video; + // TODO voice + /** * Optional. Message is a shared contact, information about the contact. */ @@ -158,6 +160,27 @@ public: * Optional. Text description of the photo or the video. */ std::string caption; + + /** + * Optional. Service message: the supergroup has been created. + */ + bool supergroupChatCreated; + + /** + * Optional. Service message: the channel has been created. + */ + bool channelChatCreated; + + /** + * Optional. The group has been migrated to a supergroup with the specified identifier, not exceeding 1e13 by absolute value. + */ + int64_t migrateToChatId; + + /** + * Optional. The supergroup has been migrated from a group with the specified identifier, not exceeding 1e13 by absolute value + */ + int64_t migrateFromChatId; + }; } diff --git a/src/TgTypeParser.cpp b/src/TgTypeParser.cpp index db44eff..53a00da 100644 --- a/src/TgTypeParser.cpp +++ b/src/TgTypeParser.cpp @@ -126,6 +126,10 @@ Message::Ptr TgTypeParser::parseJsonAndGetMessage(const ptree& data) const { result->deleteChatPhoto = data.get("delete_chat_photo", false); result->groupChatCreated = data.get("group_chat_created", false); result->caption = data.get("caption", false); + result->supergroupChatCreated = data.get("supergroup_chat_created", false); + result->channelChatCreated = data.get("channel_chat_created", false); + result->migrateToChatId = data.get<int64_t>("migrate_to_chat_id", 0); + result->migrateFromChatId = data.get<int64_t>("migrate_from_chat_id", 0); return result; } @@ -157,6 +161,10 @@ string TgTypeParser::parseMessage(const Message::Ptr& object) const { appendToJson(result, "delete_chat_photo", object->deleteChatPhoto); appendToJson(result, "group_chat_created", object->groupChatCreated); appendToJson(result, "caption", object->caption); + appendToJson(result, "supergroup_chat_created", object->supergroupChatCreated); + appendToJson(result, "channel_chat_created", object->channelChatCreated); + appendToJson(result, "migrate_to_chat_id", object->migrateToChatId); + appendToJson(result, "migrate_from_chat_id", object->migrateFromChatId); result.erase(result.length() - 1); result += '}'; return result; |