13 if (json[
"message"].isNull()) {
26 reader.parse(message, json);
37 this->forward_from = NULL;
38 this->forward_date = 0;
39 this->reply_to_message = NULL;
41 this->entities.clear();
43 this->document = NULL;
50 this->location = NULL;
52 this->new_chat_member = NULL;
53 this->left_chat_member = NULL;
54 this->new_chat_title =
"";
55 this->new_chat_photo.clear();
56 this->delete_chat_photo = 0;
57 this->group_chat_created = 0;
58 this->supergroup_chat_created = 0;
59 this->migrate_to_chat_id = 0;
60 this->pinned_message = NULL;
65 Json::Value msg = json[
"message"];
67 this->message_id = msg[
"message_id"].asUInt64();
69 this->date = msg[
"date"].asUInt64();
72 this->forward_date = msg[
"forward_date"].asUInt64();
74 this->text = msg[
"text"].asString();
75 this->setEntities(msg[
"entities"]);
76 this->audio =
new Audio(msg[
"audio"]);
77 this->document =
new Document(msg[
"document"]);
78 this->photo = this->setPhotos(msg[
"photo"]);
79 this->sticker =
new Sticker(msg[
"sticker"]);
80 this->video =
new Video(msg[
"video"]);
81 this->voice =
new Voice(msg[
"voice"]);
82 this->caption = msg[
"caption"].asString();
83 this->contact =
new Contact(msg[
"contact"]);
84 this->location =
new Location(msg[
"location"]);
85 this->venue =
new Venue(msg[
"venue"]);
86 this->new_chat_member =
new User(msg[
"new_chat_member"]);
87 this->left_chat_member =
new User(msg[
"left_chat_member"]);
88 this->new_chat_title = msg[
"new_chat_title"].asString();
89 this->new_chat_photo = this->setPhotos(msg[
"new_chat_photo"]);
90 this->delete_chat_photo = msg[
"delete_chat_photo"].asInt64();
91 this->group_chat_created = msg[
"group_chat_created"].asInt64();
92 this->supergroup_chat_created = msg[
"supergroup_chat_created"].asInt64();
93 this->migrate_to_chat_id = msg[
"migrate_to_chat_id"].asUInt64();
94 this->migrate_from_chat_id = msg[
"migrate_from_chat_id"].asUInt64();
95 this->pinned_message =
new Message(msg[
"pinned_message"]);
101 Json::ArrayIndex size = entities.size();
102 for(Json::ArrayIndex i = 0; i < size; i++) {
104 this->entities.push_back(entity);
110 Json::ArrayIndex size = photos.size();
111 std::vector<PhotoSize*> vPhotos;
113 for(Json::ArrayIndex i = 0; i < size; i++) {
115 vPhotos.push_back(photo_size);
134 return(this->entities);
void setEntities(Json::Value)
Telegram::Chat * getChat()
Telegram::TMessageEntities getEntities()
std::vector< PhotoSize * > setPhotos(Json::Value)
std::vector< Telegram::MessageEntity * > TMessageEntities