Skip to content

Message

Type · TDLib 1.8.67 · d1085f9c

Describes a message

Message(
  id: int53,
  sender_id: MessageSender,
  receiver_id: MessageSender,
  chat_id: int53,
  sending_state: MessageSendingState,
  scheduling_state: MessageSchedulingState,
  is_outgoing: Bool,
  is_pinned: Bool,
  is_from_offline: Bool,
  can_be_saved: Bool,
  has_timestamped_media: Bool,
  is_channel_post: Bool,
  is_paid_star_suggested_post: Bool,
  is_paid_gram_suggested_post: Bool,
  contains_unread_mention: Bool,
  contains_unread_poll_votes: Bool,
  date: int32,
  edit_date: int32,
  forward_info: MessageForwardInfo,
  import_info: MessageImportInfo,
  interaction_info: MessageInteractionInfo,
  unread_reactions: list of UnreadReaction,
  fact_check: FactCheck,
  suggested_post_info: SuggestedPostInfo,
  reply_to: MessageReplyTo,
  topic_id: MessageTopic,
  self_destruct_type: MessageSelfDestructType,
  self_destruct_in: double,
  auto_delete_in: double,
  via_bot_user_id: int53,
  guest_bot_caller_id: MessageSender,
  sender_business_bot_user_id: int53,
  sender_boost_count: int32,
  sender_tag: string,
  paid_message_star_count: int53,
  author_signature: string,
  media_album_id: int64,
  effect_id: int64,
  restriction_info: RestrictionInfo,
  summary_language_code: string,
  content: MessageContent,
  ephemeral_content: EphemeralMessageContent,
  reply_markup: ReplyMarkup,
  ephemeral_message_id: int32,
  chat_instance: int64
) → Message

id

int53

Message identifier; unique for the chat to which the message belongs

sender_id

MessageSender

Identifier of the sender of the message

receiver_id

MessageSender

Identifier of the user or the chat which received the ephemeral message; may be null. Always null for non-ephemeral messages

chat_id

int53

Chat identifier

sending_state

MessageSendingState

The sending state of the message; may be null if the message isn't being sent and didn't fail to be sent

scheduling_state

MessageSchedulingState

The scheduling state of the message; may be null if the message isn't scheduled

is_outgoing

Bool

True, if the message is outgoing

is_pinned

Bool

True, if the message is pinned

is_from_offline

Bool

True, if the message was sent because of a scheduled action by the message sender, for example, as away, or greeting service message

can_be_saved

Bool

True, if content of the message can be saved locally

has_timestamped_media

Bool

True, if media timestamp entities refers to a media in this message as opposed to a media in the replied message

is_channel_post

Bool

True, if the message is a channel post. All messages to channels are channel posts, all other messages are not channel posts

is_paid_star_suggested_post

Bool

True, if the message is a suggested channel post which was paid in Telegram Stars; a warning must be shown if the message is deleted in less than getOption("suggested_post_lifetime_min") seconds after sending

is_paid_gram_suggested_post

Bool

True, if the message is a suggested channel post which was paid in TON Grams; a warning must be shown if the message is deleted in less than getOption("suggested_post_lifetime_min") seconds after sending

contains_unread_mention

Bool

True, if the message contains an unread mention for the current user

contains_unread_poll_votes

Bool

True, if the message is a poll message with unread votes

date

int32

Point in time (Unix timestamp) when the message was sent; 0 for scheduled messages

edit_date

int32

Point in time (Unix timestamp) when the message was last edited; 0 for scheduled messages. If getOption("show_message_edit_date_by_default") is true, then the date must be shown along with the message instead of the date when the message was sent

forward_info

MessageForwardInfo

Information about the initial message sender; may be null if none or unknown

import_info

MessageImportInfo

Information about the initial message for messages created with importMessages; may be null if the message isn't imported

interaction_info

MessageInteractionInfo

Information about interactions with the message; may be null if none

unread_reactions

list of UnreadReaction

Information about unread reactions added to the message

fact_check

FactCheck

Information about fact-check added to the message; may be null if none

suggested_post_info

SuggestedPostInfo

Information about the suggested post; may be null if the message isn't a suggested post

reply_to

MessageReplyTo

Information about the message or the story this message is replying to; may be null if none

topic_id

MessageTopic

Identifier of the topic within the chat to which the message belongs; may be null if none; may change when the chat is converted to a forum or back

self_destruct_type

MessageSelfDestructType

The message's self-destruct type; may be null if none

self_destruct_in

double

Time left before the message self-destruct timer expires, in seconds; 0 if self-destruction isn't scheduled yet

auto_delete_in

double

Time left before the message will be automatically deleted by message_auto_delete_time setting of the chat, in seconds; 0 if never

via_bot_user_id

int53

If non-zero, the user identifier of the inline bot through which this message was sent

guest_bot_caller_id

MessageSender

The identifier of the user or chat which used a guest bot to send the message; may be null if none

sender_business_bot_user_id

int53

If non-zero, the user identifier of the business bot that sent this message

sender_boost_count

int32

Number of times the sender of the message boosted the supergroup at the time the message was sent; 0 if none or unknown. For messages sent by the current user, supergroupFullInfo.my_boost_count must be used instead

sender_tag

string

Tag of the sender of the message in the supergroup at the time the message was sent; may be empty if none or unknown. For messages sent in basic groups or supergroup administrators, the current custom title or tag must be used instead

int53

The number of Telegram Stars the sender paid to send the message

author_signature

string

For channel posts and anonymous group messages, optional author signature

media_album_id

int64

Unique identifier of an album this message belongs to; 0 if none. Only audios, documents, photos and videos can be grouped together in albums

effect_id

int64

Unique identifier of the effect added to the message; 0 if none

restriction_info

RestrictionInfo

Information about the restrictions that must be applied to the message content; may be null if none

summary_language_code

string

IETF language tag of the message language on which it can be summarized; empty if summary isn't available for the message

content

MessageContent

Content of the message

ephemeral_content

EphemeralMessageContent

Content of the message, which is visible only to the current user and must be shown instead of the regular content; may be null if none

reply_markup

ReplyMarkup

Reply markup for the message; may be null if none

ephemeral_message_id

int32

Unique identifier of the ephemeral message if the message is ephemeral; for bots only

chat_instance

int64

Identifier that uniquely corresponds to the chat to which the message was sent; for bots only