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 senderBoostCount
 Optional. If the sender of the message boosted the chat, the number of boosts added by the user.
 
User::Ptr senderBusinessBot
 Optional. The bot that actually sent the message on behalf of the business account.
 
std::uint32_t date
 Date the message was sent in Unix time.
 
std::string businessConnectionId
 Optional. Unique identifier of the business connection from which the message was received.
 
Chat::Ptr chat
 Chat the message belongs to.
 
MessageOrigin::Ptr forwardOrigin
 Optional. Information about the original message for forwarded messages.
 
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 in the same chat and message thread, the original message.
 
ExternalReplyInfo::Ptr externalReply
 Optional. Information about the message that is being replied to, which may come from another chat or forum topic.
 
TextQuote::Ptr quote
 Optional. For replies that quote part of the original message, the quoted part of the message.
 
Story::Ptr replyToStory
 Optional. For replies to a story, the original story.
 
User::Ptr viaBot
 Optional. Bot through which the message was sent.
 
std::uint32_t editDate
 Optional. Date the message was last edited in Unix time.
 
bool hasProtectedContent
 Optional. True, if the message can't be forwarded.
 
bool isFromOffline
 Optional. True, if the message was sent by an implicit action, for example, as an away or a greeting business message, or as a scheduled message.
 
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.
 
LinkPreviewOptions::Ptr linkPreviewOptions
 Optional. Options used for link preview generation for the message, if it is a text message and link preview options were changed.
 
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.
 
Story::Ptr story
 Optional. Message is a forwarded story.
 
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.
 
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.
 
UsersShared::Ptr usersShared
 Optional. Service message: users were 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 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
 
PassportData::Ptr passportData
 Optional. Telegram Passport data.
 
ProximityAlertTriggered::Ptr proximityAlertTriggered
 Optional. Service message.
 
ChatBoostAdded::Ptr boostAdded
 Optional. Service message: user boosted the chat.
 
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.
 
GiveawayCreated::Ptr giveawayCreated
 Optional. Service message: a scheduled giveaway was created.
 
Giveaway::Ptr giveaway
 Optional. The message is a scheduled giveaway message.
 
GiveawayWinners::Ptr giveawayWinners
 Optional. A giveaway with public winners was completed.
 
GiveawayCompleted::Ptr giveawayCompleted
 Optional. Service message: a giveaway without public winners was completed.
 
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 65 of file Message.h.

Member Typedef Documentation

◆ Ptr

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

Definition at line 68 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 213 of file Message.h.

◆ audio

Audio::Ptr TgBot::Message::audio

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

Definition at line 218 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 191 of file Message.h.

◆ boostAdded

ChatBoostAdded::Ptr TgBot::Message::boostAdded

Optional. Service message: user boosted the chat.

Definition at line 429 of file Message.h.

◆ businessConnectionId

std::string TgBot::Message::businessConnectionId

Optional. Unique identifier of the business connection from which the message was received.

If non-empty, the message belongs to a chat of the corresponding business account that is independent from any potential bot chat which might share the same identifier.

Definition at line 119 of file Message.h.

◆ caption

std::string TgBot::Message::caption

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

Definition at line 258 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 263 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 348 of file Message.h.

◆ chat

Chat::Ptr TgBot::Message::chat

Chat the message belongs to.

Definition at line 124 of file Message.h.

◆ chatShared

ChatShared::Ptr TgBot::Message::chatShared

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

Definition at line 400 of file Message.h.

◆ connectedWebsite

std::string TgBot::Message::connectedWebsite

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

More about Telegram Login »

Definition at line 407 of file Message.h.

◆ contact

Contact::Ptr TgBot::Message::contact

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

Definition at line 273 of file Message.h.

◆ date

std::uint32_t TgBot::Message::date

Date the message was sent in Unix time.

It is always a positive number, representing a valid date.

Definition at line 112 of file Message.h.

◆ deleteChatPhoto

bool TgBot::Message::deleteChatPhoto

Optional. Service message: the chat photo was deleted.

Definition at line 327 of file Message.h.

◆ dice

Dice::Ptr TgBot::Message::dice

Optional. Message is a dice with random value.

Definition at line 278 of file Message.h.

◆ document

Document::Ptr TgBot::Message::document

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

Definition at line 223 of file Message.h.

◆ editDate

std::uint32_t TgBot::Message::editDate

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

Definition at line 171 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 201 of file Message.h.

◆ externalReply

ExternalReplyInfo::Ptr TgBot::Message::externalReply

Optional. Information about the message that is being replied to, which may come from another chat or forum topic.

Definition at line 151 of file Message.h.

◆ forumTopicClosed

ForumTopicClosed::Ptr TgBot::Message::forumTopicClosed

Optional. Service message: forum topic closed.

Definition at line 444 of file Message.h.

◆ forumTopicCreated

ForumTopicCreated::Ptr TgBot::Message::forumTopicCreated

Optional. Service message: forum topic created.

Definition at line 434 of file Message.h.

◆ forumTopicEdited

ForumTopicEdited::Ptr TgBot::Message::forumTopicEdited

Optional. Service message: forum topic edited.

Definition at line 439 of file Message.h.

◆ forumTopicReopened

ForumTopicReopened::Ptr TgBot::Message::forumTopicReopened

Optional. Service message: forum topic reopened.

Definition at line 449 of file Message.h.

◆ forwardOrigin

MessageOrigin::Ptr TgBot::Message::forwardOrigin

Optional. Information about the original message for forwarded messages.

Definition at line 129 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 85 of file Message.h.

◆ game

Game::Ptr TgBot::Message::game

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

More about games »

Definition at line 285 of file Message.h.

◆ generalForumTopicHidden

GeneralForumTopicHidden::Ptr TgBot::Message::generalForumTopicHidden

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

Definition at line 454 of file Message.h.

◆ generalForumTopicUnhidden

GeneralForumTopicUnhidden::Ptr TgBot::Message::generalForumTopicUnhidden

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

Definition at line 459 of file Message.h.

◆ giveaway

Giveaway::Ptr TgBot::Message::giveaway

Optional. The message is a scheduled giveaway message.

Definition at line 469 of file Message.h.

◆ giveawayCompleted

GiveawayCompleted::Ptr TgBot::Message::giveawayCompleted

Optional. Service message: a giveaway without public winners was completed.

Definition at line 479 of file Message.h.

◆ giveawayCreated

GiveawayCreated::Ptr TgBot::Message::giveawayCreated

Optional. Service message: a scheduled giveaway was created.

Definition at line 464 of file Message.h.

◆ giveawayWinners

GiveawayWinners::Ptr TgBot::Message::giveawayWinners

Optional. A giveaway with public winners was completed.

Definition at line 474 of file Message.h.

◆ groupChatCreated

bool TgBot::Message::groupChatCreated

Optional. Service message: the group has been created.

Definition at line 332 of file Message.h.

◆ hasMediaSpoiler

bool TgBot::Message::hasMediaSpoiler

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

Definition at line 268 of file Message.h.

◆ hasProtectedContent

bool TgBot::Message::hasProtectedContent

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

Definition at line 176 of file Message.h.

◆ invoice

Invoice::Ptr TgBot::Message::invoice

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

More about payments »

Definition at line 383 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 139 of file Message.h.

◆ isFromOffline

bool TgBot::Message::isFromOffline

Optional. True, if the message was sent by an implicit action, for example, as an away or a greeting business message, or as a scheduled message.

Definition at line 181 of file Message.h.

◆ isTopicMessage

bool TgBot::Message::isTopicMessage

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

Definition at line 134 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 312 of file Message.h.

◆ linkPreviewOptions

LinkPreviewOptions::Ptr TgBot::Message::linkPreviewOptions

Optional. Options used for link preview generation for the message, if it is a text message and link preview options were changed.

Definition at line 206 of file Message.h.

◆ location

Location::Ptr TgBot::Message::location

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

Definition at line 302 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 186 of file Message.h.

◆ messageAutoDeleteTimerChanged

MessageAutoDeleteTimerChanged::Ptr TgBot::Message::messageAutoDeleteTimerChanged

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

Definition at line 353 of file Message.h.

◆ messageId

std::int32_t TgBot::Message::messageId

Unique message identifier inside this chat.

Definition at line 73 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 78 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 369 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 361 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 307 of file Message.h.

◆ newChatPhoto

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

Optional. A chat photo was change to this value.

Definition at line 322 of file Message.h.

◆ newChatTitle

std::string TgBot::Message::newChatTitle

Optional. A chat title was changed to this value.

Definition at line 317 of file Message.h.

◆ passportData

PassportData::Ptr TgBot::Message::passportData

Optional. Telegram Passport data.

Definition at line 417 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 228 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 itself is a reply.

Definition at line 376 of file Message.h.

◆ poll

Poll::Ptr TgBot::Message::poll

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

Definition at line 290 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 424 of file Message.h.

◆ quote

TextQuote::Ptr TgBot::Message::quote

Optional. For replies that quote part of the original message, the quoted part of the message.

Definition at line 156 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 511 of file Message.h.

◆ replyToMessage

Message::Ptr TgBot::Message::replyToMessage

Optional. For replies in the same chat and message thread, 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 146 of file Message.h.

◆ replyToStory

Story::Ptr TgBot::Message::replyToStory

Optional. For replies to a story, the original story.

Definition at line 161 of file Message.h.

◆ senderBoostCount

std::int32_t TgBot::Message::senderBoostCount

Optional. If the sender of the message boosted the chat, the number of boosts added by the user.

Definition at line 98 of file Message.h.

◆ senderBusinessBot

User::Ptr TgBot::Message::senderBusinessBot

Optional. The bot that actually sent the message on behalf of the business account.

Available only for outgoing messages sent on behalf of the connected business account.

Definition at line 105 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 93 of file Message.h.

◆ sticker

Sticker::Ptr TgBot::Message::sticker

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

Definition at line 233 of file Message.h.

◆ story

Story::Ptr TgBot::Message::story

Optional. Message is a forwarded story.

Definition at line 238 of file Message.h.

◆ successfulPayment

SuccessfulPayment::Ptr TgBot::Message::successfulPayment

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

More about payments »

Definition at line 390 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 340 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 196 of file Message.h.

◆ usersShared

UsersShared::Ptr TgBot::Message::usersShared

Optional. Service message: users were shared with the bot.

Definition at line 395 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 297 of file Message.h.

◆ viaBot

User::Ptr TgBot::Message::viaBot

Optional. Bot through which the message was sent.

Definition at line 166 of file Message.h.

◆ video

Video::Ptr TgBot::Message::video

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

Definition at line 243 of file Message.h.

◆ videoChatEnded

VideoChatEnded::Ptr TgBot::Message::videoChatEnded

Optional. Service message: video chat ended.

Definition at line 494 of file Message.h.

◆ videoChatParticipantsInvited

VideoChatParticipantsInvited::Ptr TgBot::Message::videoChatParticipantsInvited

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

Definition at line 499 of file Message.h.

◆ videoChatScheduled

VideoChatScheduled::Ptr TgBot::Message::videoChatScheduled

Optional. Service message: video chat scheduled.

Definition at line 484 of file Message.h.

◆ videoChatStarted

VideoChatStarted::Ptr TgBot::Message::videoChatStarted

Optional. Service message: video chat started.

Definition at line 489 of file Message.h.

◆ videoNote

VideoNote::Ptr TgBot::Message::videoNote

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

Definition at line 248 of file Message.h.

◆ voice

Voice::Ptr TgBot::Message::voice

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

Definition at line 253 of file Message.h.

◆ webAppData

WebAppData::Ptr TgBot::Message::webAppData

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

Definition at line 504 of file Message.h.

◆ writeAccessAllowed

WriteAccessAllowed::Ptr TgBot::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 412 of file Message.h.


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