Skip to main content

message

A message

type tg.Message struct { /* ... */ }

Implements Message.

Fields

NameTypeRequiredDescription
OutboolIs this an outgoing message
MentionedboolWhether we were mentioned in this message
MediaUnreadboolWhether there are unread media attachments in this message
SilentboolWhether this is a silent message (no notification triggered)
PostboolWhether this is a channel post
FromScheduledboolWhether this is a scheduled message
LegacyboolThis is a legacy message: it has to be refetched with the new layer
EditHideboolWhether the message should be shown as not modified to the user, even if an edit date is present
PinnedboolWhether this message is pinned
NoforwardsboolWhether this message is protected and thus cannot be forwarded; clients should also prevent users from saving attached media (i.e. videos should only be streamed, photos should be kept in RAM, et cetera).
InvertMediaboolIf set, any eventual webpage preview will be shown on top of the message instead of at the bottom.
Flags2bin.FieldsyesFlags, see TL conditional fields
OfflineboolIf set, the message was sent because of a scheduled action by the message sender, for example, as away, or a greeting service message.
VideoProcessingPendingboolThe video contained in the message is currently being processed by the server (i.e. to generate alternative qualities, that will be contained in the final messageMediaDocument.alt_document), and will be sent once the video is processed, which will happen approximately at the specified date (i.e. messages with this flag set should be treated similarly to scheduled messages, but instead of the scheduled date, date contains the estimated conversion date). See here » for more info.
PaidSuggestedPostStarsboolSet if this is a suggested channel post » that was paid using Telegram Stars.
PaidSuggestedPostTonboolSet if this is a suggested channel post » that was paid using Toncoins.
IDintyesID of the message
FromIDPeerClassID of the sender of the message
FromBoostsAppliedintSupergroups only, contains the number of boosts this user has given the current supergroup, and should be shown in the UI in the header of the message. Only present for incoming messages from non-anonymous supergroup members that have boosted the supergroup. Note that this counter should be locally overridden for non-anonymous outgoing messages, according to the current value of channelFull.boosts_applied, to ensure the value is correct even for messages sent by the current user before a supergroup was boosted (or after a boost has expired or the number of boosts has changed); do not update this value for incoming messages from other users, even if their boosts have changed.
FromRankstringOnly in supergroups » (never basic groups, where this information is contained elsewhere »), contains the sender's tag ».
PeerIDPeerClassyesPeer ID, the chat where this message was sent
SavedPeerIDPeerClassMessages from a saved messages dialog » will have peer=inputPeerSelf and the saved_peer_id flag set to the ID of the saved dialog.Messages from a monoforum » will have peer=ID of the monoforum and the saved_peer_id flag set to the ID of a topic.
FwdFromMessageFwdHeaderInfo about forwarded messages
ViaBotIDint64ID of the inline bot that generated the message
ViaBusinessBotIDint64Whether the message was sent by the business bot specified in via_bot_id on behalf of the user.
GuestchatViaFromPeerClassGuestchatViaFrom field of Message.
ReplyToMessageReplyHeaderClassReply information
DateintyesDate of the message
MessagestringyesThe message
MediaMessageMediaClassMedia attachment
ReplyMarkupReplyMarkupClassReply markup (bot/inline keyboards)
Entities[]MessageEntityClassMessage entities for styled text
ViewsintView count for channel posts
ForwardsintForward counter
RepliesMessageRepliesInfo about post comments (for channels) or message replies (for groups)
EditDateintLast edit date of this message
PostAuthorstringName of the author of this message for channel posts (with signatures enabled)
GroupedIDint64Multiple media messages sent using messages.sendMultiMedia with the same grouped ID indicate an album or media group
ReactionsMessageReactionsReactions to this message
RestrictionReason[]RestrictionReasonContains the reason why access to this message must be restricted.
TTLPeriodintTime To Live of the message, once message.date+message.ttl_period === time(), the message will be deleted on the server, and must be deleted locally as well.
QuickReplyShortcutIDintIf set, this message is a quick reply shortcut message » (note that quick reply shortcut messages sent to a private chat will not have this field set).
Effectint64A message effect that should be played as specified here ».
FactcheckFactCheckRepresents a fact-check ».
ReportDeliveryUntilDateintUsed for Telegram Gateway verification messages: if set and the current unixtime is bigger than the specified unixtime, invoke messages.reportMessagesDelivery passing the ID and the peer of this message as soon as it is received by the client (optionally batching requests for the same peer).
PaidMessageStarsint64The amount of stars the sender has paid to send the message, see here » for more info.
SuggestedPostSuggestedPostUsed to suggest a post to a channel, see here » for more info on the full flow.
ScheduleRepeatPeriodintOnce sent, this message will be automatically re-scheduled to be re-sent again this many seconds in the future, see here » for more info on repeating scheduled messages.
SummaryFromLanguagestringSummaryFromLanguage field of Message.
RichMessageRichMessageRichMessage field of Message.

References