Interface Message

Describes a message.

interface Message {
    @type: "message";
    author_signature: string;
    auto_delete_in: number;
    can_be_saved?: boolean;
    chat_id: number;
    contains_unread_mention?: boolean;
    content: MessageContent;
    date: number;
    edit_date: number;
    effect_id: string;
    fact_check: FactCheck;
    forward_info: MessageForwardInfo;
    has_sensitive_content?: boolean;
    has_timestamped_media?: boolean;
    id: number;
    import_info: MessageImportInfo;
    interaction_info: MessageInteractionInfo;
    is_channel_post?: boolean;
    is_from_offline?: boolean;
    is_outgoing?: boolean;
    is_pinned?: boolean;
    is_topic_message?: boolean;
    media_album_id: string;
    message_thread_id: number;
    reply_markup: ReplyMarkup;
    reply_to: MessageReplyTo;
    restriction_reason: string;
    saved_messages_topic_id: number;
    scheduling_state: MessageSchedulingState;
    self_destruct_in: number;
    self_destruct_type: MessageSelfDestructType;
    sender_boost_count: number;
    sender_business_bot_user_id: number;
    sender_id: MessageSender;
    sending_state: MessageSendingState;
    unread_reactions: UnreadReaction[];
    via_bot_user_id: number;
}

Properties

@type: "message"
author_signature: string

For channel posts and anonymous group messages, optional author signature.

auto_delete_in: number

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

can_be_saved?: boolean

True, if content of the message can be saved locally or copied using inputMessageForwarded or forwardMessages with copy options.

chat_id: number

Chat identifier.

contains_unread_mention?: boolean

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

Content of the message.

date: number

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

edit_date: number

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

effect_id: string

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

fact_check: FactCheck

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

forward_info: MessageForwardInfo

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

has_sensitive_content?: boolean

True, if media content of the message must be hidden with 18+ spoiler.

has_timestamped_media?: boolean

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

id: number

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

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.

is_channel_post?: boolean

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

is_from_offline?: boolean

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

is_outgoing?: boolean

True, if the message is outgoing.

is_pinned?: boolean

True, if the message is pinned.

is_topic_message?: boolean

True, if the message is a forum topic message.

media_album_id: string

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

message_thread_id: number

If non-zero, the identifier of the message thread the message belongs to; unique within the chat to which the message belongs.

reply_markup: ReplyMarkup

Reply markup for the message; may be null if none.

reply_to: MessageReplyTo

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

restriction_reason: string

If non-empty, contains a human-readable description of the reason why access to this message must be restricted.

saved_messages_topic_id: number

Identifier of the Saved Messages topic for the message; 0 for messages not from Saved Messages.

scheduling_state: MessageSchedulingState

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

self_destruct_in: number

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

self_destruct_type: MessageSelfDestructType

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

sender_boost_count: number

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_business_bot_user_id: number

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

sender_id: MessageSender

Identifier of the sender of the message.

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.

unread_reactions: UnreadReaction[]

Information about unread reactions added to the message.

via_bot_user_id: number

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