tgbotxx
1.1.6.9
Telegram Bot C++ Library
|
This object represents a message. https://core.telegram.org/bots/api#message. More...
#include <Message.hpp>
Public Member Functions | |
Message ()=default | |
Message (const nl::json &json) | |
nl::json | toJson () const |
Serializes this object to JSON. More... | |
void | fromJson (const nl::json &json) |
Deserializes this object from JSON. More... | |
Public Attributes | |
std::int32_t | messageId {} |
Unique message identifier inside this chat. More... | |
std::int32_t | messageThreadId {} |
Optional. Unique identifier of a message thread to which the message belongs; for supergroups only. More... | |
Ptr< User > | from |
Optional. Sender of the message; empty for messages sent to channels. For backward compatibility, the field contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat. More... | |
Ptr< Chat > | senderChat |
Optional. Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field from contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat. More... | |
std::time_t | date {} |
Date the message was sent in Unix time. More... | |
Ptr< Chat > | chat |
Conversation the message belongs to. More... | |
Ptr< User > | forwardFrom |
Optional. For forwarded messages, sender of the original message. More... | |
Ptr< Chat > | forwardFromChat |
Optional. For messages forwarded from channels or from anonymous administrators, information about the original sender chat. More... | |
std::int32_t | forwardFromMessageId {} |
Optional. For messages forwarded from channels, identifier of the original message in the channel. More... | |
std::string | forwardSignature |
Optional. For forwarded messages that were originally sent in channels or by an anonymous chat administrator, signature of the message sender if present. More... | |
std::string | forwardSenderName |
Optional. Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages. More... | |
std::time_t | forwardDate {} |
Optional. For forwarded messages, date the original message was sent in Unix time. More... | |
bool | isTopicMessage {} |
Optional. True, if the message is sent to a forum topic. More... | |
bool | isAutomaticForward {} |
Optional. True, if the message is a channel post that was automatically forwarded to the connected discussion group. More... | |
Ptr< Message > | replyToMessage |
Optional. For replies, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply. More... | |
Ptr< User > | viaBot |
Optional. Bot through which the message was sent. More... | |
std::time_t | editDate {} |
Optional. Date the message was last edited in Unix time. More... | |
bool | hasProtectedContent {} |
Optional. True, if the message can't be forwarded. More... | |
std::string | mediaGroupId |
Optional. The unique identifier of a media message group this message belongs to. More... | |
std::string | authorSignature |
Optional. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator. More... | |
std::string | text |
Optional. For text messages, the actual UTF-8 text of the message. More... | |
std::vector< Ptr< MessageEntity > > | entities |
Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text. More... | |
Ptr< Animation > | animation |
Optional. Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set. More... | |
Ptr< Audio > | audio |
Optional. Message is an audio file, information about the file. More... | |
Ptr< Document > | document |
Optional. Message is a general file, information about the file. More... | |
std::vector< Ptr< PhotoSize > > | photo |
Optional. Message is a photo, available sizes of the photo. More... | |
Ptr< Sticker > | sticker |
Optional. Message is a sticker, information about the sticker. More... | |
Ptr< Story > | story |
Optional. Message is a forwarded story. More... | |
Ptr< Video > | video |
Optional. Message is a video, information about the video. More... | |
Ptr< VideoNote > | videoNote |
Optional. Message is a video note, information about the video message. More... | |
Ptr< Voice > | voice |
Optional. Message is a voice message, information about the file. More... | |
std::string | caption |
Optional. Caption for the animation, audio, document, photo, video or voice. More... | |
std::vector< Ptr< MessageEntity > > | captionEntities |
Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption. More... | |
bool | hasMediaSpoiler {} |
Optional. True, if the message media is covered by a spoiler animation. More... | |
Ptr< Contact > | contact |
Optional. Message is a shared contact, information about the contact. More... | |
Ptr< Dice > | dice |
Optional. Message is a dice with random value. More... | |
Ptr< Game > | game |
Optional. Message is a game, information about the game. about games » https://core.telegram.org/bots/api#games . More... | |
Ptr< Poll > | poll |
Optional. Message is a native poll, information about the poll. More... | |
Ptr< Venue > | venue |
Optional. Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set. More... | |
Ptr< Location > | location |
Optional. Message is a shared location, information about the location. More... | |
std::vector< Ptr< User > > | newChatMembers |
Optional. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members) More... | |
Ptr< User > | leftChatMember |
Optional. A member was removed from the group, information about them (this member may be the bot itself) More... | |
std::string | newChatTitle |
Optional. A chat title was changed to this value. More... | |
Ptr< PhotoSize > | newChatPhoto |
Optional. A chat photo was change to this value. More... | |
bool | deleteChatPhoto {} |
Optional. Service message: the chat photo was deleted. More... | |
bool | groupChatCreated {} |
Optional. Service message: the group has been created. More... | |
bool | supergroupChatCreated {} |
Optional. Service message: the supergroup has been created. This field can't be received in a message coming through updates, because bot can't be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup. More... | |
bool | channelChatCreated {} |
Optional. Service message: the channel has been created. This field can't be received in a message coming through updates, because bot can't be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel. More... | |
Ptr< MessageAutoDeleteTimerChanged > | messageAutoDeleteTimerChanged |
Optional. Service message: auto-delete timer settings changed in the chat. More... | |
std::int64_t | migrateToChatId {} |
Optional. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier. More... | |
std::int64_t | migrateFromChatId {} |
Optional. The supergroup has been migrated from a group with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier. More... | |
Ptr< Message > | pinnedMessage |
Optional. Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply. More... | |
Ptr< Invoice > | invoice |
Optional. Message is an invoice for a payment, information about the invoice. about payments » https://core.telegram.org/bots/api#payments . More... | |
Ptr< SuccessfulPayment > | successfulPayment |
Optional. Message is a service message about a successful payment, information about the payment. about payments » https://core.telegram.org/bots/api#payments . More... | |
Ptr< UserShared > | userShared |
Optional. Service message: a user was shared with the bot. More... | |
Ptr< ChatShared > | chatShared |
Optional. Service message: a chat was shared with the bot. More... | |
std::string | connectedWebsite |
Optional. The domain name of the website on which the user has logged in. about Telegram Login » https://core.telegram.org/widgets/login . More... | |
Ptr< WriteAccessAllowed > | writeAccessAllowed |
Optional. Service message: the user allowed the bot to write messages after adding it to the attachment or side menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess. More... | |
Ptr< PassportData > | passportData |
Optional. Telegram Passport data. More... | |
Ptr< ProximityAlertTriggered > | proximityAlertTriggered |
Optional. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location. More... | |
Ptr< ForumTopicCreated > | forumTopicCreated |
Optional. Service message: forum topic created. More... | |
Ptr< ForumTopicEdited > | forumTopicEdited |
Optional. Service message: forum topic edited. More... | |
Ptr< ForumTopicClosed > | forumTopicClosed |
Optional. Service message: forum topic closed. More... | |
Ptr< ForumTopicReopened > | forumTopicReopened |
Optional. Service message: forum topic reopened. More... | |
Ptr< GeneralForumTopicHidden > | generalForumTopicHidden |
Optional. Service message: the 'General' forum topic hidden. More... | |
Ptr< GeneralForumTopicUnhidden > | generalForumTopicUnhidden |
Optional. Service message: the 'General' forum topic unhidden. More... | |
Ptr< VideoChatScheduled > | videoChatScheduled |
Optional. Service message: video chat scheduled. More... | |
Ptr< VideoChatStarted > | videoChatStarted |
Optional. Service message: video chat started. More... | |
Ptr< VideoChatEnded > | videoChatEnded |
Optional. Service message: video chat ended. More... | |
Ptr< VideoChatParticipantsInvited > | videoChatParticipantsInvited |
Optional. Service message: new participants invited to a video chat. More... | |
Ptr< WebAppData > | webAppData |
Optional. Service message: data sent by a Web App. More... | |
Ptr< InlineKeyboardMarkup > | replyMarkup |
Optional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons. More... | |
This object represents a message. https://core.telegram.org/bots/api#message.
Definition at line 48 of file Message.hpp.
|
default |
|
inlineexplicit |
Definition at line 50 of file Message.hpp.
void tgbotxx::Message::fromJson | ( | const nl::json & | json | ) |
Deserializes this object from JSON.
nl::json tgbotxx::Message::toJson | ( | ) | const |
Serializes this object to JSON.
Optional. Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set.
Definition at line 132 of file Message.hpp.
Optional. Message is an audio file, information about the file.
Definition at line 135 of file Message.hpp.
std::string tgbotxx::Message::authorSignature |
Optional. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator.
Definition at line 122 of file Message.hpp.
std::string tgbotxx::Message::caption |
Optional. Caption for the animation, audio, document, photo, video or voice.
Definition at line 159 of file Message.hpp.
std::vector<Ptr<MessageEntity> > tgbotxx::Message::captionEntities |
Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption.
Definition at line 162 of file Message.hpp.
bool tgbotxx::Message::channelChatCreated {} |
Optional. Service message: the channel has been created. This field can't be received in a message coming through updates, because bot can't be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel.
Definition at line 213 of file Message.hpp.
Conversation the message belongs to.
Definition at line 74 of file Message.hpp.
Ptr<ChatShared> tgbotxx::Message::chatShared |
Optional. Service message: a chat was shared with the bot.
Definition at line 245 of file Message.hpp.
std::string tgbotxx::Message::connectedWebsite |
Optional. The domain name of the website on which the user has logged in. about Telegram Login » https://core.telegram.org/widgets/login .
Definition at line 249 of file Message.hpp.
Optional. Message is a shared contact, information about the contact.
Definition at line 168 of file Message.hpp.
std::time_t tgbotxx::Message::date {} |
Date the message was sent in Unix time.
Definition at line 71 of file Message.hpp.
bool tgbotxx::Message::deleteChatPhoto {} |
Optional. Service message: the chat photo was deleted.
Definition at line 200 of file Message.hpp.
Optional. Message is a dice with random value.
Definition at line 171 of file Message.hpp.
Optional. Message is a general file, information about the file.
Definition at line 138 of file Message.hpp.
std::time_t tgbotxx::Message::editDate {} |
Optional. Date the message was last edited in Unix time.
Definition at line 112 of file Message.hpp.
std::vector<Ptr<MessageEntity> > tgbotxx::Message::entities |
Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text.
Definition at line 128 of file Message.hpp.
Ptr<ForumTopicClosed> tgbotxx::Message::forumTopicClosed |
Optional. Service message: forum topic closed.
Definition at line 268 of file Message.hpp.
Ptr<ForumTopicCreated> tgbotxx::Message::forumTopicCreated |
Optional. Service message: forum topic created.
Definition at line 262 of file Message.hpp.
Ptr<ForumTopicEdited> tgbotxx::Message::forumTopicEdited |
Optional. Service message: forum topic edited.
Definition at line 265 of file Message.hpp.
Ptr<ForumTopicReopened> tgbotxx::Message::forumTopicReopened |
Optional. Service message: forum topic reopened.
Definition at line 271 of file Message.hpp.
std::time_t tgbotxx::Message::forwardDate {} |
Optional. For forwarded messages, date the original message was sent in Unix time.
Definition at line 95 of file Message.hpp.
Optional. For forwarded messages, sender of the original message.
Definition at line 77 of file Message.hpp.
Optional. For messages forwarded from channels or from anonymous administrators, information about the original sender chat.
Definition at line 81 of file Message.hpp.
std::int32_t tgbotxx::Message::forwardFromMessageId {} |
Optional. For messages forwarded from channels, identifier of the original message in the channel.
Definition at line 84 of file Message.hpp.
std::string tgbotxx::Message::forwardSenderName |
Optional. Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages.
Definition at line 92 of file Message.hpp.
std::string tgbotxx::Message::forwardSignature |
Optional. For forwarded messages that were originally sent in channels or by an anonymous chat administrator, signature of the message sender if present.
Definition at line 88 of file Message.hpp.
Optional. Sender of the message; empty for messages sent to channels. For backward compatibility, the field contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.
Definition at line 62 of file Message.hpp.
Optional. Message is a game, information about the game. about games » https://core.telegram.org/bots/api#games .
Definition at line 175 of file Message.hpp.
Ptr<GeneralForumTopicHidden> tgbotxx::Message::generalForumTopicHidden |
Optional. Service message: the 'General' forum topic hidden.
Definition at line 274 of file Message.hpp.
Ptr<GeneralForumTopicUnhidden> tgbotxx::Message::generalForumTopicUnhidden |
Optional. Service message: the 'General' forum topic unhidden.
Definition at line 277 of file Message.hpp.
bool tgbotxx::Message::groupChatCreated {} |
Optional. Service message: the group has been created.
Definition at line 203 of file Message.hpp.
bool tgbotxx::Message::hasMediaSpoiler {} |
Optional. True, if the message media is covered by a spoiler animation.
Definition at line 165 of file Message.hpp.
bool tgbotxx::Message::hasProtectedContent {} |
Optional. True, if the message can't be forwarded.
Definition at line 115 of file Message.hpp.
Optional. Message is an invoice for a payment, information about the invoice. about payments » https://core.telegram.org/bots/api#payments .
Definition at line 235 of file Message.hpp.
bool tgbotxx::Message::isAutomaticForward {} |
Optional. True, if the message is a channel post that was automatically forwarded to the connected discussion group.
Definition at line 102 of file Message.hpp.
bool tgbotxx::Message::isTopicMessage {} |
Optional. True, if the message is sent to a forum topic.
Definition at line 98 of file Message.hpp.
Optional. A member was removed from the group, information about them (this member may be the bot itself)
Definition at line 191 of file Message.hpp.
Optional. Message is a shared location, information about the location.
Definition at line 185 of file Message.hpp.
std::string tgbotxx::Message::mediaGroupId |
Optional. The unique identifier of a media message group this message belongs to.
Definition at line 118 of file Message.hpp.
Ptr<MessageAutoDeleteTimerChanged> tgbotxx::Message::messageAutoDeleteTimerChanged |
Optional. Service message: auto-delete timer settings changed in the chat.
Definition at line 216 of file Message.hpp.
std::int32_t tgbotxx::Message::messageId {} |
Unique message identifier inside this chat.
Definition at line 55 of file Message.hpp.
std::int32_t tgbotxx::Message::messageThreadId {} |
Optional. Unique identifier of a message thread to which the message belongs; for supergroups only.
Definition at line 58 of file Message.hpp.
std::int64_t tgbotxx::Message::migrateFromChatId {} |
Optional. The supergroup has been migrated from a group with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
Definition at line 228 of file Message.hpp.
std::int64_t tgbotxx::Message::migrateToChatId {} |
Optional. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
Definition at line 222 of file Message.hpp.
Optional. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members)
Definition at line 188 of file Message.hpp.
Optional. A chat photo was change to this value.
Definition at line 197 of file Message.hpp.
std::string tgbotxx::Message::newChatTitle |
Optional. A chat title was changed to this value.
Definition at line 194 of file Message.hpp.
Ptr<PassportData> tgbotxx::Message::passportData |
Optional. Telegram Passport data.
Definition at line 256 of file Message.hpp.
Optional. Message is a photo, available sizes of the photo.
Definition at line 141 of file Message.hpp.
Optional. Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply.
Definition at line 231 of file Message.hpp.
Optional. Message is a native poll, information about the poll.
Definition at line 178 of file Message.hpp.
Ptr<ProximityAlertTriggered> tgbotxx::Message::proximityAlertTriggered |
Optional. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location.
Definition at line 259 of file Message.hpp.
Ptr<InlineKeyboardMarkup> tgbotxx::Message::replyMarkup |
Optional. Inline keyboard attached to the message. login_url
buttons are represented as ordinary url
buttons.
Definition at line 295 of file Message.hpp.
Optional. For replies, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.
Definition at line 106 of file Message.hpp.
Optional. Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field from contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.
Definition at line 68 of file Message.hpp.
Optional. Message is a sticker, information about the sticker.
Definition at line 144 of file Message.hpp.
Optional. Message is a forwarded story.
Definition at line 147 of file Message.hpp.
Ptr<SuccessfulPayment> tgbotxx::Message::successfulPayment |
Optional. Message is a service message about a successful payment, information about the payment. about payments » https://core.telegram.org/bots/api#payments .
Definition at line 239 of file Message.hpp.
bool tgbotxx::Message::supergroupChatCreated {} |
Optional. Service message: the supergroup has been created. This field can't be received in a message coming through updates, because bot can't be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup.
Definition at line 208 of file Message.hpp.
std::string tgbotxx::Message::text |
Optional. For text messages, the actual UTF-8 text of the message.
Definition at line 125 of file Message.hpp.
Ptr<UserShared> tgbotxx::Message::userShared |
Optional. Service message: a user was shared with the bot.
Definition at line 242 of file Message.hpp.
Optional. Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set.
Definition at line 182 of file Message.hpp.
Optional. Bot through which the message was sent.
Definition at line 109 of file Message.hpp.
Optional. Message is a video, information about the video.
Definition at line 150 of file Message.hpp.
Ptr<VideoChatEnded> tgbotxx::Message::videoChatEnded |
Optional. Service message: video chat ended.
Definition at line 286 of file Message.hpp.
Ptr<VideoChatParticipantsInvited> tgbotxx::Message::videoChatParticipantsInvited |
Optional. Service message: new participants invited to a video chat.
Definition at line 289 of file Message.hpp.
Ptr<VideoChatScheduled> tgbotxx::Message::videoChatScheduled |
Optional. Service message: video chat scheduled.
Definition at line 280 of file Message.hpp.
Ptr<VideoChatStarted> tgbotxx::Message::videoChatStarted |
Optional. Service message: video chat started.
Definition at line 283 of file Message.hpp.
Optional. Message is a video note, information about the video message.
Definition at line 153 of file Message.hpp.
Optional. Message is a voice message, information about the file.
Definition at line 156 of file Message.hpp.
Ptr<WebAppData> tgbotxx::Message::webAppData |
Optional. Service message: data sent by a Web App.
Definition at line 292 of file Message.hpp.
Ptr<WriteAccessAllowed> tgbotxx::Message::writeAccessAllowed |
Optional. Service message: the user allowed the bot to write messages after adding it to the attachment or side menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess.
Definition at line 253 of file Message.hpp.