tgbot-cpp
Message.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 Oleg Morozenkov
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a copy
5  * of this software and associated documentation files (the "Software"), to deal
6  * in the Software without restriction, including without limitation the rights
7  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8  * copies of the Software, and to permit persons to whom the Software is
9  * furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in all
12  * copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20  * SOFTWARE.
21  */
22 
23 #ifndef TGBOT_CPP_MESSAGE_H
24 #define TGBOT_CPP_MESSAGE_H
25 
26 #include <string>
27 #include <vector>
28 #include <memory>
29 
30 #include "tgbot/types/Chat.h"
31 #include "tgbot/types/User.h"
32 #include "tgbot/types/Message.h"
33 #include "tgbot/types/Audio.h"
34 #include "tgbot/types/Document.h"
35 #include "tgbot/types/Sticker.h"
36 #include "tgbot/types/Video.h"
37 #include "tgbot/types/Contact.h"
38 #include "tgbot/types/Location.h"
39 #include "tgbot/types/Game.h"
40 #include "tgbot/types/PhotoSize.h"
42 #include "tgbot/types/Venue.h"
43 #include "tgbot/types/Voice.h"
44 
45 namespace TgBot {
46 
52 class Message {
53 public:
54  typedef std::shared_ptr<Message> Ptr;
55 
57  deleteChatPhoto = false;
58  groupChatCreated = false;
59  supergroupChatCreated = false;
60  channelChatCreated = false;
61  migrateToChatId = 0;
63  }
64 
68  int32_t messageId;
69 
74 
78  int32_t date;
79 
84 
89 
94 
99 
103  std::string forwardSignature;
104 
108  int32_t forwardDate;
109 
114 
118  int32_t editDate;
119 
123  std::string authorSignature;
124 
128  std::string text;
129 
133  std::vector<MessageEntity::Ptr> entities;
134 
138  std::vector<MessageEntity::Ptr> captionEntities;
139 
144 
149 
154 
158  std::vector<PhotoSize::Ptr> photo;
159 
164 
169 
174 
178  std::string caption;
179 
184 
189 
194 
199 
203  std::vector<User::Ptr> newChatMembers;
204 
209 
213  std::string newChatTitle;
214 
218  std::vector<PhotoSize::Ptr> newChatPhoto;
219 
224 
229 
234 
239 
244 
249 
254 
258  std::string connectedWebsite;
259 };
260 
261 }
262 
263 #endif //TGBOT_CPP_MESSAGE_H
bool channelChatCreated
Optional. Service message: the channel has been created.
Definition: Message.h:238
int64_t migrateToChatId
Optional. The group has been migrated to a supergroup with the specified identifier, not exceeding 1e13 by absolute value.
Definition: Message.h:243
std::shared_ptr< Sticker > Ptr
Definition: Sticker.h:42
bool supergroupChatCreated
Optional. Service message: the supergroup has been created.
Definition: Message.h:233
std::shared_ptr< Audio > Ptr
Definition: Audio.h:39
User::Ptr forwardFrom
Optional. For forwarded messages, sender of the original message.
Definition: Message.h:88
std::vector< MessageEntity::Ptr > entities
Optional. For text messages, special entities like usernames, URLs, bot commands, etc...
Definition: Message.h:133
std::string caption
Optional. Caption for the document, photo or video, 0-200 characters.
Definition: Message.h:178
User::Ptr leftChatMember
Optional. A member was removed from the group, information about them (this member may be bot itself)...
Definition: Message.h:208
std::string text
Optional. For text messages, the actual UTF-8 text of the message.
Definition: Message.h:128
Definition: Api.h:47
std::shared_ptr< Game > Ptr
Definition: Game.h:46
Video::Ptr video
Optional. Message is a video, information about the video.
Definition: Message.h:168
Message::Ptr pinnedMessage
Optional. Specified message was pinned. Note that the Message object in this field will not contain f...
Definition: Message.h:253
Chat::Ptr chat
Conversation the message belongs to.
Definition: Message.h:83
bool groupChatCreated
Optional. Informs that the group has been created.
Definition: Message.h:228
Game::Ptr game
Optional. Message is a game, information about the game.
Definition: Message.h:153
std::vector< PhotoSize::Ptr > newChatPhoto
Optional. A group photo was change to this value.
Definition: Message.h:218
std::shared_ptr< Message > Ptr
Definition: Message.h:54
std::vector< PhotoSize::Ptr > photo
Optional. Message is a photo, available sizes of the photo.
Definition: Message.h:158
std::string forwardSignature
Optional. For messages forwarded from channels, signature of the post author if present.
Definition: Message.h:103
std::shared_ptr< Location > Ptr
Definition: Location.h:38
std::vector< User::Ptr > newChatMembers
Optional. New members that were added to the group or supergroup and information about them (the bot ...
Definition: Message.h:203
Sticker::Ptr sticker
Optional. Message is a sticker, information about the sticker.
Definition: Message.h:163
int64_t migrateFromChatId
Optional. The supergroup has been migrated from a group with the specified identifier, not exceeding 1e13 by absolute value.
Definition: Message.h:248
Document::Ptr document
Optional. Message is a general file, information about the file.
Definition: Message.h:148
int32_t editDate
Optional. Date the message was last edited in Unix time.
Definition: Message.h:118
Chat::Ptr forwardFromChat
Optional. For messages forwarded from a channel, information about the original channel.
Definition: Message.h:93
Venue::Ptr venue
Optional. Message is a venue, information about the venue.
Definition: Message.h:193
int32_t forwardFromMessageId
Optional. For forwarded channel posts, identifier of the original message in the channel.
Definition: Message.h:98
std::string newChatTitle
Optional. A group title was changed to this value.
Definition: Message.h:213
Contact::Ptr contact
Optional. Message is a shared contact, information about the contact.
Definition: Message.h:183
std::vector< MessageEntity::Ptr > captionEntities
Optional. For messages with a caption, special entities like usernames, URLs, bot commands...
Definition: Message.h:138
Audio::Ptr audio
Optional. Message is an audio file, information about the file.
Definition: Message.h:143
std::shared_ptr< Document > Ptr
Definition: Document.h:41
std::shared_ptr< Chat > Ptr
Definition: Chat.h:41
int32_t forwardDate
Optional. For forwarded messages, date the original message was sent in Unix time.
Definition: Message.h:108
int32_t messageId
Unique message identifier.
Definition: Message.h:68
Message::Ptr replyToMessage
Optional. For replies, the original message. Note that the Message object in this field will not cont...
Definition: Message.h:113
std::shared_ptr< Voice > Ptr
Definition: Voice.h:20
User::Ptr from
Optional. Sender, can be empty for messages sent to channels.
Definition: Message.h:73
bool deleteChatPhoto
Optional. Informs that the group photo was deleted.
Definition: Message.h:223
std::string connectedWebsite
Optional. The domain name of the website on which the user has logged in.
Definition: Message.h:258
Location::Ptr location
Optional. Message is a shared location, information about the location.
Definition: Message.h:188
std::shared_ptr< Video > Ptr
Definition: Video.h:41
std::shared_ptr< Contact > Ptr
Definition: Contact.h:39
std::string authorSignature
Optional. Signature of the post author for messages in channels.
Definition: Message.h:123
std::shared_ptr< Venue > Ptr
Definition: Venue.h:22
int32_t date
Date the message was sent in Unix time.
Definition: Message.h:78
User::Ptr newChatMember
Optional. A new member was added to the group, information about them (this member may be bot itself)...
Definition: Message.h:198
This object represents a message.
Definition: Message.h:52
Voice::Ptr voice
Optional. Message is a voice message, information about the file.
Definition: Message.h:173
std::shared_ptr< User > Ptr
Definition: User.h:39