12 if (json[
"message"].isNull()) {
25 reader.parse(message, json);
36 this->forward_from = NULL;
37 this->forward_date = 0;
38 this->reply_to_message = NULL;
40 this->entities.clear();
42 this->document = NULL;
49 this->location = NULL;
51 this->new_chat_member = NULL;
52 this->left_chat_member = NULL;
53 this->new_chat_title =
"";
54 this->new_chat_photo.clear();
55 this->delete_chat_photo = 0;
56 this->group_chat_created = 0;
57 this->supergroup_chat_created = 0;
58 this->migrate_to_chat_id = 0;
59 this->pinned_message = NULL;
64 Json::Value msg = json[
"message"];
66 this->message_id = msg[
"message_id"].asUInt64();
68 this->date = msg[
"date"].asUInt64();
71 this->forward_date = msg[
"forward_date"].asUInt64();
73 this->text = msg[
"text"].asString();
74 this->setEntities(msg[
"entities"]);
75 this->audio =
new Audio(msg[
"audio"]);
76 this->document =
new Document(msg[
"document"]);
77 this->photo = this->setPhotos(msg[
"photo"]);
78 this->sticker =
new Sticker(msg[
"sticker"]);
79 this->video =
new Video(msg[
"video"]);
80 this->voice =
new Voice(msg[
"voice"]);
81 this->caption = msg[
"caption"].asString();
82 this->contact =
new Contact(msg[
"contact"]);
83 this->location =
new Location(msg[
"location"]);
84 this->venue =
new Venue(msg[
"venue"]);
85 this->new_chat_member =
new User(msg[
"new_chat_member"]);
86 this->left_chat_member =
new User(msg[
"left_chat_member"]);
87 this->new_chat_title = msg[
"new_chat_title"].asString();
88 this->new_chat_photo = this->setPhotos(msg[
"new_chat_photo"]);
89 this->delete_chat_photo = msg[
"delete_chat_photo"].asInt64();
90 this->group_chat_created = msg[
"group_chat_created"].asInt64();
91 this->supergroup_chat_created = msg[
"supergroup_chat_created"].asInt64();
92 this->migrate_to_chat_id = msg[
"migrate_to_chat_id"].asUInt64();
93 this->migrate_from_chat_id = msg[
"migrate_from_chat_id"].asUInt64();
94 this->pinned_message =
new Message(msg[
"pinned_message"]);
100 Json::ArrayIndex size = entities.size();
101 for(Json::ArrayIndex i = 0; i < size; i++) {
103 this->entities.push_back(entity);
109 Json::ArrayIndex size = photos.size();
110 std::vector<PhotoSize*> vPhotos;
112 for(Json::ArrayIndex i = 0; i < size; i++) {
114 vPhotos.push_back(photo_size);
133 return(this->entities);
void setEntities(Json::Value)
Telegram::Chat * getChat()
Telegram::TMessageEntities getEntities()
std::vector< PhotoSize * > setPhotos(Json::Value)
std::vector< Telegram::MessageEntity * > TMessageEntities