message #

A message

Layer 223

message#3ae56482 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true noforwards:flags.26?true invert_media:flags.27?true flags2:# offline:flags2.1?true video_processing_pending:flags2.4?true paid_suggested_post_stars:flags2.8?true paid_suggested_post_ton:flags2.9?true id:int from_id:flags.8?Peer from_boosts_applied:flags.29?int from_rank:flags2.12?string peer_id:Peer saved_peer_id:flags.28?Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long via_business_bot_id:flags2.0?long reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long reactions:flags.20?MessageReactions restriction_reason:flags.22?Vector<RestrictionReason> ttl_period:flags.25?int quick_reply_shortcut_id:flags.30?int effect:flags2.2?long factcheck:flags2.3?FactCheck report_delivery_until_date:flags2.5?int paid_message_stars:flags2.6?long suggested_post:flags2.7?SuggestedPost schedule_repeat_period:flags2.10?int summary_from_language:flags2.11?string = Message;

Parameters #

NameTypeDescription
flags#Flags, see TL conditional fields
outflags.1?trueIs this an outgoing message
mentionedflags.4?trueWhether we were mentioned in this message
media_unreadflags.5?trueWhether there are unread media attachments in this message, see here » for more info on how to clear this flag.
silentflags.13?trueWhether this is a silent message (no notification triggered)
postflags.14?trueWhether this is a channel post
from_scheduledflags.18?trueWhether this is a scheduled message
legacyflags.19?trueThis is a legacy message: it has to be refetched with the new layer
edit_hideflags.21?trueWhether the message should be shown as not modified to the user, even if an edit date is present
pinnedflags.24?trueWhether this message is pinned
noforwardsflags.26?trueWhether 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).
invert_mediaflags.27?trueIf set, any eventual webpage preview will be shown on top of the message instead of at the bottom.
flags2#Flags, see TL conditional fields
offlineflags2.1?trueIf set, the message was sent because of a scheduled action by the message sender, for example, as away, or a greeting service message.
video_processing_pendingflags2.4?trueThe 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.
paid_suggested_post_starsflags2.8?trueSet if this is a suggested channel post » that was paid using Telegram Stars.
paid_suggested_post_tonflags2.9?trueSet if this is a suggested channel post » that was paid using Grams.
idintID of the message
from_idflags.8?PeerID of the sender of the message
from_boosts_appliedflags.29?intSupergroups 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.
from_rankflags2.12?stringOnly in supergroups » (never basic groups, where this information is contained elsewhere »), contains the sender's tag ».
peer_idPeerPeer ID, the chat where this message was sent
saved_peer_idflags.28?PeerMessages 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.
fwd_fromflags.2?MessageFwdHeaderInfo about forwarded messages
via_bot_idflags.11?longID of the inline bot that generated the message
via_business_bot_idflags2.0?longWhether the message was sent by the business bot specified in via_bot_id on behalf of the user.
guestchat_via_fromflags2.19?PeerIf the message was posted by a guest bot », the peer on whose behalf the bot sent the message.
reply_toflags.3?MessageReplyHeaderReply information
dateintDate of the message
messagestringThe message
mediaflags.9?MessageMediaMedia attachment
reply_markupflags.6?ReplyMarkupReply markup (bot/inline keyboards)
entitiesflags.7?Vector<MessageEntity>Message entities for styled text
viewsflags.10?intView count for channel posts
forwardsflags.10?intForward counter
repliesflags.23?MessageRepliesInfo about post comments (for channels) or message replies (for groups)
edit_dateflags.15?intLast edit date of this message
post_authorflags.16?stringName of the author of this message for channel posts (with signatures enabled)
grouped_idflags.17?longMultiple media messages sent using messages.sendMultiMedia with the same grouped ID indicate an album or media group
reactionsflags.20?MessageReactionsReactions to this message
restriction_reasonflags.22?Vector<RestrictionReason>Contains the reason why access to this message must be restricted.
ttl_periodflags.25?intTime 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.
quick_reply_shortcut_idflags.30?intIf 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).
effectflags2.2?longA message effect that should be played as specified here ».
factcheckflags2.3?FactCheckRepresents a fact-check ».
report_delivery_until_dateflags2.5?intUsed 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).
paid_message_starsflags2.6?longThe amount of stars the sender has paid to send the message, see here » for more info.
suggested_postflags2.7?SuggestedPostUsed to suggest a post to a channel, see here » for more info on the full flow.
schedule_repeat_periodflags2.10?intOnce 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.
summary_from_languageflags2.11?stringIf set, clients should offer a summarization button » for this message; contains the two-letter ISO 639-1 language code of the inferred language of the current message.

Type #

Message

Mentions and replies #

Telegram allows mentioning other users in case of urgent duckling matters, and quickly navigating to those mentions in order to read them as swiftly as possible.

Views and read metrics #

Clients should report read state, message views and music listens using a specific set of methods.

Scheduled messages #

Telegram allows scheduling messages

Pinned messages #

Telegram allows pinning multiple messages on top of a specific chat.

messageMediaDocument #

Document (video, audio, voice, sticker, any media type except photo)

Uploading and Downloading Files #

How to transfer large data batches correctly.

Suggested posts #

Telegram offers a powerful monetization feature to channel administrators: suggested posts.

Telegram Stars #

Telegram Stars are virtual items that allow users to purchase digital goods and services from bots and mini apps inside the Telegram ecosystem, send gifts to content creators on the Telegram platform, and more.

Channel and supergroup boosts #

Telegram Premium users can grant their favorite channels and supergroups additional features like the ability to post stories by giving them boosts.

channelFull #

Full info about a channel, supergroup or gigagroup.

When updating the local peer database », all fields from the newly received constructor take priority over the old constructor cached locally (including by removing fields that aren't set in the new constructor).

Channels, supergroups, gigagroups and basic groups #

How to handle channels, supergroups, gigagroups, basic groups, and what's the difference between them.

Group participant tags #

Members in group chats (both basic groups and supergroups) can add a tag next to their name — to show their role at work, what they study in school, and more.

Saved messages #

The Saved Messages chat allows users to bookmark messages and media: it's a personal cloud storage for any messages or media you may want to send or forward there.

inputPeerSelf #

Defines the current user.

Direct messages to channels #

Telegram supports direct messages to channels, which can also be used to suggest (even paid) channel posts.

Connected business bots #

Users can connect Telegram bots that will process and answer messages on their behalf. This allows them to seamlessly integrate any existing tools and workflows, or add AI assistants that manage their chats.

Guest mode for bots #

Guest bots can be queried by username from any non-secret private chat, group and supergroup (except for groups/supergroups with content protection » enabled), posting their results directly into the chat, even if they're not a member.

Styled text with message entities #

How to create styled text with message entities

Message threads #

Telegram allows commenting on a channel post or on a generic supergroup message, thanks to message threads.

messages.sendMultiMedia #

Send an album or grouped media

Telegram Business #

Users can turn their Telegram account into a business account, gaining access to business features such as opening hours, location, quick replies, automated messages, custom start pages, chatbot support, and more.

Animated message effects #

Telegram allows adding spectacular animated effects to messages you send.

Fact checks #

Telegram clients support displaying fact-checks added to messages by independent fact-checkers.

messages.reportMessagesDelivery #

Used for Telegram Gateway verification messages »: indicate to the server that one or more messages were received by the client, if requested by the message.report_delivery_until_date flag or the equivalent flag in push notifications.

Telegram Stars can be used to pay for sending messages to users, supergroups and channels that have configured paid messages, requiring a payment for every message sent to them.

AI features #

Telegram offers many AI features powered by Cocoon — a decentralized network designed to maximize privacy.