tgbot-cpp
Loading...
Searching...
No Matches
TgBot::Message Class Reference

This object represents a message. More...

#include <Message.h>

Public Types

typedef std::shared_ptr< MessagePtr
 

Public Attributes

std::int32_t messageId
 Unique message identifier inside this chat.
 
std::int32_t messageThreadId
 Optional. Unique identifier of a message thread to which the message belongs; for supergroups only.
 
User::Ptr from
 Optional. Sender of the message; empty for messages sent to channels.
 
Chat::Ptr senderChat
 Optional. Sender of the message, sent on behalf of a chat.
 
std::int32_t date
 Date the message was sent in Unix time.
 
Chat::Ptr chat
 Conversation the message belongs to.
 
User::Ptr forwardFrom
 Optional. For forwarded messages, sender of the original message.
 
Chat::Ptr forwardFromChat
 Optional. For messages forwarded from channels or from anonymous administrators, information about the original sender chat.
 
std::int32_t forwardFromMessageId
 Optional. For messages forwarded from channels, identifier of the original message in the channel.
 
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.
 
std::string forwardSenderName
 Optional. Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages.
 
std::int32_t forwardDate
 Optional. For forwarded messages, date the original message was sent in Unix time.
 
bool isTopicMessage
 Optional. True, if the message is sent to a forum topic.
 
bool isAutomaticForward
 Optional. True, if the message is a channel post that was automatically forwarded to the connected discussion group.
 
Message::Ptr replyToMessage
 Optional. For replies, the original message.
 
User::Ptr viaBot
 Optional. Bot through which the message was sent.
 
std::int32_t editDate
 Optional. Date the message was last edited in Unix time.
 
bool hasProtectedContent
 Optional. True, if the message can't be forwarded.
 
std::string mediaGroupId
 Optional. The unique identifier of a media message group this message belongs to.
 
std::string authorSignature
 Optional. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator.
 
std::string text
 Optional. For text messages, the actual UTF-8 text of the message.
 
std::vector< MessageEntity::Ptrentities
 Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text.
 
Animation::Ptr animation
 Optional. Message is an animation, information about the animation.
 
Audio::Ptr audio
 Optional. Message is an audio file, information about the file.
 
Document::Ptr document
 Optional. Message is a general file, information about the file.
 
std::vector< PhotoSize::Ptrphoto
 Optional. Message is a photo, available sizes of the photo.
 
Sticker::Ptr sticker
 Optional. Message is a sticker, information about the sticker.
 
Video::Ptr video
 Optional. Message is a video, information about the video.
 
VideoNote::Ptr videoNote
 Optional. Message is a video note, information about the video message.
 
Voice::Ptr voice
 Optional. Message is a voice message, information about the file.
 
std::string caption
 Optional. Caption for the animation, audio, document, photo, video or voice.
 
std::vector< MessageEntity::PtrcaptionEntities
 Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption.
 
bool hasMediaSpoiler
 Optional. True, if the message media is covered by a spoiler animation.
 
Contact::Ptr contact
 Optional. Message is a shared contact, information about the contact.
 
Dice::Ptr dice
 Optional. Message is a dice with random value.
 
Game::Ptr game
 Optional. Message is a game, information about the game. https://core.telegram.org/bots/api#games.
 
Poll::Ptr poll
 Optional. Message is a native poll, information about the poll.
 
Venue::Ptr venue
 Optional. Message is a venue, information about the venue.
 
Location::Ptr location
 Optional. Message is a shared location, information about the location.
 
std::vector< User::PtrnewChatMembers
 Optional. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members)
 
User::Ptr leftChatMember
 Optional. A member was removed from the group, information about them (this member may be the bot itself)
 
std::string newChatTitle
 Optional. A chat title was changed to this value.
 
std::vector< PhotoSize::PtrnewChatPhoto
 Optional. A chat photo was change to this value.
 
bool deleteChatPhoto
 Optional. Service message: the chat photo was deleted.
 
bool groupChatCreated
 Optional. Service message: the group has been created.
 
bool supergroupChatCreated
 Optional. Service message: the supergroup has been created.
 
bool channelChatCreated
 Optional. Service message: the channel has been created.
 
MessageAutoDeleteTimerChanged::Ptr messageAutoDeleteTimerChanged
 Optional. Service message: auto-delete timer settings changed in the chat.
 
std::int64_t migrateToChatId
 Optional. The group has been migrated to a supergroup with the specified identifier.
 
std::int64_t migrateFromChatId
 Optional. The supergroup has been migrated from a group with the specified identifier.
 
Message::Ptr pinnedMessage
 Optional. Specified message was pinned.
 
Invoice::Ptr invoice
 Optional. Message is an invoice for a payment, information about the invoice.
 
SuccessfulPayment::Ptr successfulPayment
 Optional. Message is a service message about a successful payment, information about the payment.
 
UserShared::Ptr userShared
 Optional. Service message: a user was shared with the bot.
 
ChatShared::Ptr chatShared
 Optional. Service message: a chat was shared with the bot.
 
std::string connectedWebsite
 Optional. The domain name of the website on which the user has logged in.
 
WriteAccessAllowed::Ptr writeAccessAllowed
 Optional. Service message: the user allowed the bot added to the attachment menu to write messages.
 
PassportData::Ptr passportData
 Optional. Telegram Passport data.
 
ProximityAlertTriggered::Ptr proximityAlertTriggered
 Optional. Service message.
 
ForumTopicCreated::Ptr forumTopicCreated
 Optional. Service message: forum topic created.
 
ForumTopicEdited::Ptr forumTopicEdited
 Optional. Service message: forum topic edited.
 
ForumTopicClosed::Ptr forumTopicClosed
 Optional. Service message: forum topic closed.
 
ForumTopicReopened::Ptr forumTopicReopened
 Optional. Service message: forum topic reopened.
 
GeneralForumTopicHidden::Ptr generalForumTopicHidden
 Optional. Service message: the 'General' forum topic hidden.
 
GeneralForumTopicUnhidden::Ptr generalForumTopicUnhidden
 Optional. Service message: the 'General' forum topic unhidden.
 
VideoChatScheduled::Ptr videoChatScheduled
 Optional. Service message: video chat scheduled.
 
VideoChatStarted::Ptr videoChatStarted
 Optional. Service message: video chat started.
 
VideoChatEnded::Ptr videoChatEnded
 Optional. Service message: video chat ended.
 
VideoChatParticipantsInvited::Ptr videoChatParticipantsInvited
 Optional. Service message: new participants invited to a video chat.
 
WebAppData::Ptr webAppData
 Optional. Service message: data sent by a Web App.
 
InlineKeyboardMarkup::Ptr replyMarkup
 Optional. Inline keyboard attached to the message.
 

Detailed Description

This object represents a message.

Definition at line 55 of file Message.h.

Member Typedef Documentation

◆ Ptr

typedef std::shared_ptr<Message> TgBot::Message::Ptr

Definition at line 57 of file Message.h.

Member Data Documentation

◆ animation

Animation::Ptr TgBot::Message::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

Definition at line 181 of file Message.h.

◆ audio

Audio::Ptr TgBot::Message::audio

Optional. Message is an audio file, information about the file.

Definition at line 186 of file Message.h.

◆ authorSignature

std::string TgBot::Message::authorSignature

Optional. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator.

Definition at line 164 of file Message.h.

◆ caption

std::string TgBot::Message::caption

Optional. Caption for the animation, audio, document, photo, video or voice.

Definition at line 221 of file Message.h.

◆ captionEntities

std::vector<MessageEntity::Ptr> TgBot::Message::captionEntities

Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption.

Definition at line 226 of file Message.h.

◆ channelChatCreated

bool TgBot::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 replyToMessage if someone replies to a very first message in a channel.

Definition at line 309 of file Message.h.

◆ chat

Chat::Ptr TgBot::Message::chat

Conversation the message belongs to.

Definition at line 92 of file Message.h.

◆ chatShared

ChatShared::Ptr TgBot::Message::chatShared

Optional. Service message: a chat was shared with the bot.

Definition at line 361 of file Message.h.

◆ connectedWebsite

std::string TgBot::Message::connectedWebsite

Optional. The domain name of the website on which the user has logged in.

https://core.telegram.org/widgets/login

Definition at line 368 of file Message.h.

◆ contact

Contact::Ptr TgBot::Message::contact

Optional. Message is a shared contact, information about the contact.

Definition at line 236 of file Message.h.

◆ date

std::int32_t TgBot::Message::date

Date the message was sent in Unix time.

Definition at line 87 of file Message.h.

◆ deleteChatPhoto

bool TgBot::Message::deleteChatPhoto

Optional. Service message: the chat photo was deleted.

Definition at line 288 of file Message.h.

◆ dice

Dice::Ptr TgBot::Message::dice

Optional. Message is a dice with random value.

Definition at line 241 of file Message.h.

◆ document

Document::Ptr TgBot::Message::document

Optional. Message is a general file, information about the file.

Definition at line 191 of file Message.h.

◆ editDate

std::int32_t TgBot::Message::editDate

Optional. Date the message was last edited in Unix time.

Definition at line 149 of file Message.h.

◆ entities

std::vector<MessageEntity::Ptr> TgBot::Message::entities

Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text.

Definition at line 174 of file Message.h.

◆ forumTopicClosed

ForumTopicClosed::Ptr TgBot::Message::forumTopicClosed

Optional. Service message: forum topic closed.

Definition at line 400 of file Message.h.

◆ forumTopicCreated

ForumTopicCreated::Ptr TgBot::Message::forumTopicCreated

Optional. Service message: forum topic created.

Definition at line 390 of file Message.h.

◆ forumTopicEdited

ForumTopicEdited::Ptr TgBot::Message::forumTopicEdited

Optional. Service message: forum topic edited.

Definition at line 395 of file Message.h.

◆ forumTopicReopened

ForumTopicReopened::Ptr TgBot::Message::forumTopicReopened

Optional. Service message: forum topic reopened.

Definition at line 405 of file Message.h.

◆ forwardDate

std::int32_t TgBot::Message::forwardDate

Optional. For forwarded messages, date the original message was sent in Unix time.

Definition at line 122 of file Message.h.

◆ forwardFrom

User::Ptr TgBot::Message::forwardFrom

Optional. For forwarded messages, sender of the original message.

Definition at line 97 of file Message.h.

◆ forwardFromChat

Chat::Ptr TgBot::Message::forwardFromChat

Optional. For messages forwarded from channels or from anonymous administrators, information about the original sender chat.

Definition at line 102 of file Message.h.

◆ forwardFromMessageId

std::int32_t TgBot::Message::forwardFromMessageId

Optional. For messages forwarded from channels, identifier of the original message in the channel.

Definition at line 107 of file Message.h.

◆ forwardSenderName

std::string TgBot::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 117 of file Message.h.

◆ forwardSignature

std::string TgBot::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 112 of file Message.h.

◆ from

User::Ptr TgBot::Message::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.

Definition at line 74 of file Message.h.

◆ game

Game::Ptr TgBot::Message::game

Optional. Message is a game, information about the game. https://core.telegram.org/bots/api#games.

Definition at line 246 of file Message.h.

◆ generalForumTopicHidden

GeneralForumTopicHidden::Ptr TgBot::Message::generalForumTopicHidden

Optional. Service message: the 'General' forum topic hidden.

Definition at line 410 of file Message.h.

◆ generalForumTopicUnhidden

GeneralForumTopicUnhidden::Ptr TgBot::Message::generalForumTopicUnhidden

Optional. Service message: the 'General' forum topic unhidden.

Definition at line 415 of file Message.h.

◆ groupChatCreated

bool TgBot::Message::groupChatCreated

Optional. Service message: the group has been created.

Definition at line 293 of file Message.h.

◆ hasMediaSpoiler

bool TgBot::Message::hasMediaSpoiler

Optional. True, if the message media is covered by a spoiler animation.

Definition at line 231 of file Message.h.

◆ hasProtectedContent

bool TgBot::Message::hasProtectedContent

Optional. True, if the message can't be forwarded.

Definition at line 154 of file Message.h.

◆ invoice

Invoice::Ptr TgBot::Message::invoice

Optional. Message is an invoice for a payment, information about the invoice.

https://core.telegram.org/bots/api#payments

Definition at line 344 of file Message.h.

◆ isAutomaticForward

bool TgBot::Message::isAutomaticForward

Optional. True, if the message is a channel post that was automatically forwarded to the connected discussion group.

Definition at line 132 of file Message.h.

◆ isTopicMessage

bool TgBot::Message::isTopicMessage

Optional. True, if the message is sent to a forum topic.

Definition at line 127 of file Message.h.

◆ leftChatMember

User::Ptr TgBot::Message::leftChatMember

Optional. A member was removed from the group, information about them (this member may be the bot itself)

Definition at line 273 of file Message.h.

◆ location

Location::Ptr TgBot::Message::location

Optional. Message is a shared location, information about the location.

Definition at line 263 of file Message.h.

◆ mediaGroupId

std::string TgBot::Message::mediaGroupId

Optional. The unique identifier of a media message group this message belongs to.

Definition at line 159 of file Message.h.

◆ messageAutoDeleteTimerChanged

MessageAutoDeleteTimerChanged::Ptr TgBot::Message::messageAutoDeleteTimerChanged

Optional. Service message: auto-delete timer settings changed in the chat.

Definition at line 314 of file Message.h.

◆ messageId

std::int32_t TgBot::Message::messageId

Unique message identifier inside this chat.

Definition at line 62 of file Message.h.

◆ messageThreadId

std::int32_t TgBot::Message::messageThreadId

Optional. Unique identifier of a message thread to which the message belongs; for supergroups only.

Definition at line 67 of file Message.h.

◆ migrateFromChatId

std::int64_t TgBot::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 330 of file Message.h.

◆ migrateToChatId

std::int64_t TgBot::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 322 of file Message.h.

◆ newChatMembers

std::vector<User::Ptr> TgBot::Message::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)

Definition at line 268 of file Message.h.

◆ newChatPhoto

std::vector<PhotoSize::Ptr> TgBot::Message::newChatPhoto

Optional. A chat photo was change to this value.

Definition at line 283 of file Message.h.

◆ newChatTitle

std::string TgBot::Message::newChatTitle

Optional. A chat title was changed to this value.

Definition at line 278 of file Message.h.

◆ passportData

PassportData::Ptr TgBot::Message::passportData

Optional. Telegram Passport data.

Definition at line 378 of file Message.h.

◆ photo

std::vector<PhotoSize::Ptr> TgBot::Message::photo

Optional. Message is a photo, available sizes of the photo.

Definition at line 196 of file Message.h.

◆ pinnedMessage

Message::Ptr TgBot::Message::pinnedMessage

Optional. Specified message was pinned.

Note that the Message object in this field will not contain further replyToMessage fields even if it is itself a reply.

Definition at line 337 of file Message.h.

◆ poll

Poll::Ptr TgBot::Message::poll

Optional. Message is a native poll, information about the poll.

Definition at line 251 of file Message.h.

◆ proximityAlertTriggered

ProximityAlertTriggered::Ptr TgBot::Message::proximityAlertTriggered

Optional. Service message.

A user in the chat triggered another user's proximity alert while sharing Live Location.

Definition at line 385 of file Message.h.

◆ replyMarkup

InlineKeyboardMarkup::Ptr TgBot::Message::replyMarkup

Optional. Inline keyboard attached to the message.

loginUrl buttons are represented as ordinary url buttons.

Definition at line 447 of file Message.h.

◆ replyToMessage

Message::Ptr TgBot::Message::replyToMessage

Optional. For replies, the original message.

Note that the Message object in this field will not contain further replyToMessage fields even if it itself is a reply.

Definition at line 139 of file Message.h.

◆ senderChat

Chat::Ptr TgBot::Message::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.

Definition at line 82 of file Message.h.

◆ sticker

Sticker::Ptr TgBot::Message::sticker

Optional. Message is a sticker, information about the sticker.

Definition at line 201 of file Message.h.

◆ successfulPayment

SuccessfulPayment::Ptr TgBot::Message::successfulPayment

Optional. Message is a service message about a successful payment, information about the payment.

https://core.telegram.org/bots/api#payments

Definition at line 351 of file Message.h.

◆ supergroupChatCreated

bool TgBot::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 replyToMessage if someone replies to a very first message in a directly created supergroup.

Definition at line 301 of file Message.h.

◆ text

std::string TgBot::Message::text

Optional. For text messages, the actual UTF-8 text of the message.

Definition at line 169 of file Message.h.

◆ userShared

UserShared::Ptr TgBot::Message::userShared

Optional. Service message: a user was shared with the bot.

Definition at line 356 of file Message.h.

◆ venue

Venue::Ptr TgBot::Message::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

Definition at line 258 of file Message.h.

◆ viaBot

User::Ptr TgBot::Message::viaBot

Optional. Bot through which the message was sent.

Definition at line 144 of file Message.h.

◆ video

Video::Ptr TgBot::Message::video

Optional. Message is a video, information about the video.

Definition at line 206 of file Message.h.

◆ videoChatEnded

VideoChatEnded::Ptr TgBot::Message::videoChatEnded

Optional. Service message: video chat ended.

Definition at line 430 of file Message.h.

◆ videoChatParticipantsInvited

VideoChatParticipantsInvited::Ptr TgBot::Message::videoChatParticipantsInvited

Optional. Service message: new participants invited to a video chat.

Definition at line 435 of file Message.h.

◆ videoChatScheduled

VideoChatScheduled::Ptr TgBot::Message::videoChatScheduled

Optional. Service message: video chat scheduled.

Definition at line 420 of file Message.h.

◆ videoChatStarted

VideoChatStarted::Ptr TgBot::Message::videoChatStarted

Optional. Service message: video chat started.

Definition at line 425 of file Message.h.

◆ videoNote

VideoNote::Ptr TgBot::Message::videoNote

Optional. Message is a video note, information about the video message.

Definition at line 211 of file Message.h.

◆ voice

Voice::Ptr TgBot::Message::voice

Optional. Message is a voice message, information about the file.

Definition at line 216 of file Message.h.

◆ webAppData

WebAppData::Ptr TgBot::Message::webAppData

Optional. Service message: data sent by a Web App.

Definition at line 440 of file Message.h.

◆ writeAccessAllowed

WriteAccessAllowed::Ptr TgBot::Message::writeAccessAllowed

Optional. Service message: the user allowed the bot added to the attachment menu to write messages.

Definition at line 373 of file Message.h.


The documentation for this class was generated from the following file: