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 #include "tgbot/types/Invoice.h"
46 
47 namespace TgBot {
48 
54 class Message {
55 public:
56  typedef std::shared_ptr<Message> Ptr;
57 
61  int32_t messageId;
62 
67 
71  int32_t date;
72 
77 
82 
87 
92 
96  std::string forwardSignature;
97 
101  int32_t forwardDate;
102 
107 
111  int32_t editDate;
112 
116  std::string authorSignature;
117 
121  std::string text;
122 
126  std::vector<MessageEntity::Ptr> entities;
127 
131  std::vector<MessageEntity::Ptr> captionEntities;
132 
137 
142 
147 
151  std::vector<PhotoSize::Ptr> photo;
152 
157 
162 
167 
171  std::string caption;
172 
177 
182 
187 
192 
196  std::vector<User::Ptr> newChatMembers;
197 
202 
206  std::string newChatTitle;
207 
211  std::vector<PhotoSize::Ptr> newChatPhoto;
212 
216  bool deleteChatPhoto = false;
217 
221  bool groupChatCreated = false;
222 
226  bool supergroupChatCreated = false;
227 
231  bool channelChatCreated = false;
232 
236  int64_t migrateToChatId = 0;
237 
241  int64_t migrateFromChatId = 0;
242 
247 
252 
257 
261  std::string connectedWebsite;
262 };
263 
264 }
265 
266 #endif //TGBOT_CPP_MESSAGE_H
bool channelChatCreated
Optional. Service message: the channel has been created.
Definition: Message.h:231
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:236
std::shared_ptr< Sticker > Ptr
Definition: Sticker.h:42
bool supergroupChatCreated
Optional. Service message: the supergroup has been created.
Definition: Message.h:226
std::shared_ptr< Audio > Ptr
Definition: Audio.h:39
User::Ptr forwardFrom
Optional. For forwarded messages, sender of the original message.
Definition: Message.h:81
std::vector< MessageEntity::Ptr > entities
Optional. For text messages, special entities like usernames, URLs, bot commands, etc...
Definition: Message.h:126
std::string caption
Optional. Caption for the document, photo or video, 0-200 characters.
Definition: Message.h:171
User::Ptr leftChatMember
Optional. A member was removed from the group, information about them (this member may be bot itself)...
Definition: Message.h:201
std::string text
Optional. For text messages, the actual UTF-8 text of the message.
Definition: Message.h:121
Definition: Api.h:49
std::shared_ptr< Game > Ptr
Definition: Game.h:46
Video::Ptr video
Optional. Message is a video, information about the video.
Definition: Message.h:161
Message::Ptr pinnedMessage
Optional. Specified message was pinned. Note that the Message object in this field will not contain f...
Definition: Message.h:246
Chat::Ptr chat
Conversation the message belongs to.
Definition: Message.h:76
SuccessfulPayment::Ptr successfulPayment
Optional. Message is a service message about a successful payment, information about the payment...
Definition: Message.h:256
bool groupChatCreated
Optional. Informs that the group has been created.
Definition: Message.h:221
Game::Ptr game
Optional. Message is a game, information about the game.
Definition: Message.h:146
std::vector< PhotoSize::Ptr > newChatPhoto
Optional. A group photo was change to this value.
Definition: Message.h:211
std::shared_ptr< Message > Ptr
Definition: Message.h:56
std::vector< PhotoSize::Ptr > photo
Optional. Message is a photo, available sizes of the photo.
Definition: Message.h:151
std::string forwardSignature
Optional. For messages forwarded from channels, signature of the post author if present.
Definition: Message.h:96
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:196
Sticker::Ptr sticker
Optional. Message is a sticker, information about the sticker.
Definition: Message.h:156
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:241
Document::Ptr document
Optional. Message is a general file, information about the file.
Definition: Message.h:141
int32_t editDate
Optional. Date the message was last edited in Unix time.
Definition: Message.h:111
Chat::Ptr forwardFromChat
Optional. For messages forwarded from a channel, information about the original channel.
Definition: Message.h:86
Venue::Ptr venue
Optional. Message is a venue, information about the venue.
Definition: Message.h:186
int32_t forwardFromMessageId
Optional. For forwarded channel posts, identifier of the original message in the channel.
Definition: Message.h:91
std::string newChatTitle
Optional. A group title was changed to this value.
Definition: Message.h:206
Contact::Ptr contact
Optional. Message is a shared contact, information about the contact.
Definition: Message.h:176
std::vector< MessageEntity::Ptr > captionEntities
Optional. For messages with a caption, special entities like usernames, URLs, bot commands...
Definition: Message.h:131
std::shared_ptr< SuccessfulPayment > Ptr
Audio::Ptr audio
Optional. Message is an audio file, information about the file.
Definition: Message.h:136
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:101
int32_t messageId
Unique message identifier.
Definition: Message.h:61
Message::Ptr replyToMessage
Optional. For replies, the original message. Note that the Message object in this field will not cont...
Definition: Message.h:106
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:66
bool deleteChatPhoto
Optional. Informs that the group photo was deleted.
Definition: Message.h:216
Invoice::Ptr invoice
Optional. Message is an invoice for a payment, information about the invoice.
Definition: Message.h:251
std::string connectedWebsite
Optional. The domain name of the website on which the user has logged in.
Definition: Message.h:261
std::shared_ptr< Invoice > Ptr
Definition: Invoice.h:41
Location::Ptr location
Optional. Message is a shared location, information about the location.
Definition: Message.h:181
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:116
std::shared_ptr< Venue > Ptr
Definition: Venue.h:22
int32_t date
Date the message was sent in Unix time.
Definition: Message.h:71
User::Ptr newChatMember
Optional. A new member was added to the group, information about them (this member may be bot itself)...
Definition: Message.h:191
This object represents a message.
Definition: Message.h:54
Voice::Ptr voice
Optional. Message is a voice message, information about the file.
Definition: Message.h:166
std::shared_ptr< User > Ptr
Definition: User.h:39