tgbot-cpp
Loading...
Searching...
No Matches
Message.h
Go to the documentation of this file.
1#ifndef TGBOT_MESSAGE_H
2#define TGBOT_MESSAGE_H
3
4#include "tgbot/types/User.h"
5#include "tgbot/types/Chat.h"
9#include "tgbot/types/Audio.h"
12#include "tgbot/types/Sticker.h"
13#include "tgbot/types/Video.h"
15#include "tgbot/types/Voice.h"
16#include "tgbot/types/Contact.h"
17#include "tgbot/types/Dice.h"
18#include "tgbot/types/Game.h"
19#include "tgbot/types/Poll.h"
20#include "tgbot/types/Venue.h"
23#include "tgbot/types/Invoice.h"
42
43#include <cstdint>
44#include <string>
45#include <vector>
46#include <memory>
47
48namespace TgBot {
49
55class Message {
56public:
57 typedef std::shared_ptr<Message> Ptr;
58
62 std::int32_t messageId;
63
67 std::int32_t messageThreadId;
68
75
83
87 std::int32_t date;
88
93
98
103
108
112 std::string forwardSignature;
113
117 std::string forwardSenderName;
118
122 std::int32_t forwardDate;
123
128
133
140
145
149 std::int32_t editDate;
150
155
159 std::string mediaGroupId;
160
164 std::string authorSignature;
165
169 std::string text;
170
174 std::vector<MessageEntity::Ptr> entities;
175
182
187
192
196 std::vector<PhotoSize::Ptr> photo;
197
202
207
212
217
221 std::string caption;
222
226 std::vector<MessageEntity::Ptr> captionEntities;
227
232
237
242
247
252
259
264
268 std::vector<User::Ptr> newChatMembers;
269
274
278 std::string newChatTitle;
279
283 std::vector<PhotoSize::Ptr> newChatPhoto;
284
289
294
302
310
315
322 std::int64_t migrateToChatId;
323
330 std::int64_t migrateFromChatId;
331
338
345
352
357
362
368 std::string connectedWebsite;
369
374
379
386
391
396
401
406
411
416
421
426
431
436
441
448};
449}
450
451#endif //TGBOT_MESSAGE_H
std::shared_ptr< Animation > Ptr
Definition Animation.h:19
std::shared_ptr< Audio > Ptr
Definition Audio.h:20
std::shared_ptr< Chat > Ptr
Definition Chat.h:25
std::shared_ptr< ChatShared > Ptr
Definition ChatShared.h:17
std::shared_ptr< Contact > Ptr
Definition Contact.h:17
std::shared_ptr< Dice > Ptr
Definition Dice.h:16
std::shared_ptr< Document > Ptr
Definition Document.h:20
std::shared_ptr< ForumTopicClosed > Ptr
std::shared_ptr< ForumTopicCreated > Ptr
std::shared_ptr< ForumTopicEdited > Ptr
std::shared_ptr< ForumTopicReopened > Ptr
std::shared_ptr< Game > Ptr
Definition Game.h:23
std::shared_ptr< GeneralForumTopicHidden > Ptr
std::shared_ptr< GeneralForumTopicUnhidden > Ptr
std::shared_ptr< InlineKeyboardMarkup > Ptr
std::shared_ptr< Invoice > Ptr
Definition Invoice.h:19
std::shared_ptr< Location > Ptr
Definition Location.h:16
std::shared_ptr< MessageAutoDeleteTimerChanged > Ptr
This object represents a message.
Definition Message.h:55
WebAppData::Ptr webAppData
Optional. Service message: data sent by a Web App.
Definition Message.h:440
std::int32_t forwardFromMessageId
Optional. For messages forwarded from channels, identifier of the original message in the channel.
Definition Message.h:107
bool isTopicMessage
Optional. True, if the message is sent to a forum topic.
Definition Message.h:127
std::vector< MessageEntity::Ptr > captionEntities
Optional. For messages with a caption, special entities like usernames, URLs, bot commands,...
Definition Message.h:226
ForumTopicEdited::Ptr forumTopicEdited
Optional. Service message: forum topic edited.
Definition Message.h:395
User::Ptr leftChatMember
Optional. A member was removed from the group, information about them (this member may be the bot its...
Definition Message.h:273
GeneralForumTopicHidden::Ptr generalForumTopicHidden
Optional. Service message: the 'General' forum topic hidden.
Definition Message.h:410
std::int64_t migrateToChatId
Optional. The group has been migrated to a supergroup with the specified identifier.
Definition Message.h:322
std::string caption
Optional. Caption for the animation, audio, document, photo, video or voice.
Definition Message.h:221
Message::Ptr replyToMessage
Optional. For replies, the original message.
Definition Message.h:139
std::string newChatTitle
Optional. A chat title was changed to this value.
Definition Message.h:278
bool deleteChatPhoto
Optional. Service message: the chat photo was deleted.
Definition Message.h:288
std::shared_ptr< Message > Ptr
Definition Message.h:57
Poll::Ptr poll
Optional. Message is a native poll, information about the poll.
Definition Message.h:251
PassportData::Ptr passportData
Optional. Telegram Passport data.
Definition Message.h:378
ForumTopicReopened::Ptr forumTopicReopened
Optional. Service message: forum topic reopened.
Definition Message.h:405
VideoNote::Ptr videoNote
Optional. Message is a video note, information about the video message.
Definition Message.h:211
std::int32_t messageId
Unique message identifier inside this chat.
Definition Message.h:62
std::string mediaGroupId
Optional. The unique identifier of a media message group this message belongs to.
Definition Message.h:159
std::string connectedWebsite
Optional. The domain name of the website on which the user has logged in.
Definition Message.h:368
Voice::Ptr voice
Optional. Message is a voice message, information about the file.
Definition Message.h:216
Animation::Ptr animation
Optional. Message is an animation, information about the animation.
Definition Message.h:181
bool supergroupChatCreated
Optional. Service message: the supergroup has been created.
Definition Message.h:301
std::string forwardSenderName
Optional. Sender's name for messages forwarded from users who disallow adding a link to their account...
Definition Message.h:117
Audio::Ptr audio
Optional. Message is an audio file, information about the file.
Definition Message.h:186
VideoChatParticipantsInvited::Ptr videoChatParticipantsInvited
Optional. Service message: new participants invited to a video chat.
Definition Message.h:435
bool channelChatCreated
Optional. Service message: the channel has been created.
Definition Message.h:309
std::vector< MessageEntity::Ptr > entities
Optional. For text messages, special entities like usernames, URLs, bot commands, etc....
Definition Message.h:174
std::int32_t editDate
Optional. Date the message was last edited in Unix time.
Definition Message.h:149
bool groupChatCreated
Optional. Service message: the group has been created.
Definition Message.h:293
VideoChatStarted::Ptr videoChatStarted
Optional. Service message: video chat started.
Definition Message.h:425
std::string authorSignature
Optional. Signature of the post author for messages in channels, or the custom title of an anonymous ...
Definition Message.h:164
bool hasProtectedContent
Optional. True, if the message can't be forwarded.
Definition Message.h:154
Game::Ptr game
Optional. Message is a game, information about the game. https://core.telegram.org/bots/api#games.
Definition Message.h:246
User::Ptr from
Optional. Sender of the message; empty for messages sent to channels.
Definition Message.h:74
std::string forwardSignature
Optional. For forwarded messages that were originally sent in channels or by an anonymous chat admini...
Definition Message.h:112
std::vector< PhotoSize::Ptr > photo
Optional. Message is a photo, available sizes of the photo.
Definition Message.h:196
std::int32_t date
Date the message was sent in Unix time.
Definition Message.h:87
bool hasMediaSpoiler
Optional. True, if the message media is covered by a spoiler animation.
Definition Message.h:231
Chat::Ptr chat
Conversation the message belongs to.
Definition Message.h:92
ChatShared::Ptr chatShared
Optional. Service message: a chat was shared with the bot.
Definition Message.h:361
User::Ptr forwardFrom
Optional. For forwarded messages, sender of the original message.
Definition Message.h:97
std::int32_t messageThreadId
Optional. Unique identifier of a message thread to which the message belongs; for supergroups only.
Definition Message.h:67
std::int64_t migrateFromChatId
Optional. The supergroup has been migrated from a group with the specified identifier.
Definition Message.h:330
VideoChatEnded::Ptr videoChatEnded
Optional. Service message: video chat ended.
Definition Message.h:430
User::Ptr viaBot
Optional. Bot through which the message was sent.
Definition Message.h:144
WriteAccessAllowed::Ptr writeAccessAllowed
Optional. Service message: the user allowed the bot added to the attachment menu to write messages.
Definition Message.h:373
std::vector< PhotoSize::Ptr > newChatPhoto
Optional. A chat photo was change to this value.
Definition Message.h:283
Message::Ptr pinnedMessage
Optional. Specified message was pinned.
Definition Message.h:337
std::int32_t forwardDate
Optional. For forwarded messages, date the original message was sent in Unix time.
Definition Message.h:122
Venue::Ptr venue
Optional. Message is a venue, information about the venue.
Definition Message.h:258
InlineKeyboardMarkup::Ptr replyMarkup
Optional. Inline keyboard attached to the message.
Definition Message.h:447
SuccessfulPayment::Ptr successfulPayment
Optional. Message is a service message about a successful payment, information about the payment.
Definition Message.h:351
Document::Ptr document
Optional. Message is a general file, information about the file.
Definition Message.h:191
bool isAutomaticForward
Optional. True, if the message is a channel post that was automatically forwarded to the connected di...
Definition Message.h:132
Sticker::Ptr sticker
Optional. Message is a sticker, information about the sticker.
Definition Message.h:201
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:268
Chat::Ptr senderChat
Optional. Sender of the message, sent on behalf of a chat.
Definition Message.h:82
ProximityAlertTriggered::Ptr proximityAlertTriggered
Optional. Service message.
Definition Message.h:385
Dice::Ptr dice
Optional. Message is a dice with random value.
Definition Message.h:241
Video::Ptr video
Optional. Message is a video, information about the video.
Definition Message.h:206
UserShared::Ptr userShared
Optional. Service message: a user was shared with the bot.
Definition Message.h:356
VideoChatScheduled::Ptr videoChatScheduled
Optional. Service message: video chat scheduled.
Definition Message.h:420
GeneralForumTopicUnhidden::Ptr generalForumTopicUnhidden
Optional. Service message: the 'General' forum topic unhidden.
Definition Message.h:415
Contact::Ptr contact
Optional. Message is a shared contact, information about the contact.
Definition Message.h:236
Invoice::Ptr invoice
Optional. Message is an invoice for a payment, information about the invoice.
Definition Message.h:344
ForumTopicCreated::Ptr forumTopicCreated
Optional. Service message: forum topic created.
Definition Message.h:390
Chat::Ptr forwardFromChat
Optional. For messages forwarded from channels or from anonymous administrators, information about th...
Definition Message.h:102
MessageAutoDeleteTimerChanged::Ptr messageAutoDeleteTimerChanged
Optional. Service message: auto-delete timer settings changed in the chat.
Definition Message.h:314
std::string text
Optional. For text messages, the actual UTF-8 text of the message.
Definition Message.h:169
Location::Ptr location
Optional. Message is a shared location, information about the location.
Definition Message.h:263
ForumTopicClosed::Ptr forumTopicClosed
Optional. Service message: forum topic closed.
Definition Message.h:400
std::shared_ptr< PassportData > Ptr
std::shared_ptr< Poll > Ptr
Definition Poll.h:22
std::shared_ptr< ProximityAlertTriggered > Ptr
std::shared_ptr< Sticker > Ptr
Definition Sticker.h:22
std::shared_ptr< SuccessfulPayment > Ptr
std::shared_ptr< User > Ptr
Definition User.h:18
std::shared_ptr< UserShared > Ptr
Definition UserShared.h:17
std::shared_ptr< Venue > Ptr
Definition Venue.h:18
std::shared_ptr< VideoChatEnded > Ptr
std::shared_ptr< VideoChatParticipantsInvited > Ptr
std::shared_ptr< VideoChatScheduled > Ptr
std::shared_ptr< VideoChatStarted > Ptr
std::shared_ptr< Video > Ptr
Definition Video.h:20
std::shared_ptr< VideoNote > Ptr
Definition VideoNote.h:20
std::shared_ptr< Voice > Ptr
Definition Voice.h:17
std::shared_ptr< WebAppData > Ptr
Definition WebAppData.h:16
std::shared_ptr< WriteAccessAllowed > Ptr
Definition Api.h:39