From ad8ca77ece2b3185ca546f120dc4f7a13e602aa2 Mon Sep 17 00:00:00 2001 From: JellyBrick Date: Tue, 29 May 2018 21:55:25 +0900 Subject: Bot API 2.2 (Game) update --- src/TgTypeParser.cpp | 86 +++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 82 insertions(+), 4 deletions(-) (limited to 'src/TgTypeParser.cpp') diff --git a/src/TgTypeParser.cpp b/src/TgTypeParser.cpp index 4ba571f..20ed9a2 100644 --- a/src/TgTypeParser.cpp +++ b/src/TgTypeParser.cpp @@ -113,7 +113,7 @@ string TgTypeParser::parseUser(const User::Ptr& object) const { return result; } -MessageEntity::Ptr TgTypeParser::parseJsonAndGetEntity(const ptree& data) const{ +MessageEntity::Ptr TgTypeParser::parseJsonAndGetMessageEntity(const ptree& data) const{ auto result(make_shared()); result->type = data.get("type"); result->offset = data.get("offset"); @@ -138,10 +138,11 @@ Message::Ptr TgTypeParser::parseJsonAndGetMessage(const ptree& data) const { result->editDate = data.get("edit_date", 0); result->authorSignature = data.get("author_signature", ""); result->text = data.get("text", ""); - result->entities = parseJsonAndGetArray(&TgTypeParser::parseJsonAndGetEntity, data, "entities"); - result->captionEntities = parseJsonAndGetArray(&TgTypeParser::parseJsonAndGetEntity, data, "caption_entities"); + result->entities = parseJsonAndGetArray(&TgTypeParser::parseJsonAndGetMessageEntity, data, "entities"); + result->captionEntities = parseJsonAndGetArray(&TgTypeParser::parseJsonAndGetMessageEntity, data, "caption_entities"); result->audio = tryParseJson