Interface Message

This object represents a message.

interface Message {
    animation?: Animation;
    audio?: Audio;
    author_signature?: string;
    boost_added?: ChatBoostAdded;
    business_connection_id?: string;
    caption?: string;
    caption_entities?: MessageEntity[];
    channel_chat_created?: true;
    chat: Chat;
    chat_background_set?: ChatBackground;
    chat_shared?: ChatShared;
    connected_website?: string;
    contact?: Contact;
    date: number;
    delete_chat_photo?: true;
    dice?: Dice;
    document?: Document;
    edit_date?: number;
    effect_id?: string;
    entities?: MessageEntity[];
    external_reply?: ExternalReplyInfo;
    forum_topic_closed?: ForumTopicClosed;
    forum_topic_created?: ForumTopicCreated;
    forum_topic_edited?: ForumTopicEdited;
    forum_topic_reopened?: ForumTopicReopened;
    forward_origin?: MessageOrigin;
    from?: User;
    game?: Game;
    general_forum_topic_hidden?: GeneralForumTopicHidden;
    general_forum_topic_unhidden?: GeneralForumTopicUnhidden;
    giveaway?: Giveaway;
    giveaway_completed?: GiveawayCompleted;
    giveaway_created?: GiveawayCreated;
    giveaway_winners?: GiveawayWinners;
    group_chat_created?: true;
    has_media_spoiler?: true;
    has_protected_content?: true;
    invoice?: Invoice;
    is_automatic_forward?: true;
    is_from_offline?: true;
    is_topic_message?: boolean;
    left_chat_member?: User;
    link_preview_options?: LinkPreviewOptions;
    location?: Location;
    media_group_id?: string;
    message_auto_delete_timer_changed?: MessageAutoDeleteTimerChanged;
    message_id: number;
    message_thread_id?: number;
    migrate_from_chat_id?: number;
    migrate_to_chat_id?: number;
    new_chat_members?: User[];
    new_chat_photo?: PhotoSize[];
    new_chat_title?: string;
    paid_media?: PaidMediaInfo;
    passport_data?: PassportData;
    photo?: PhotoSize[];
    pinned_message?: MaybeInaccessibleMessage;
    poll?: Poll;
    proximity_alert_triggered?: ProximityAlertTriggered;
    quote?: TextQuote;
    refunded_payment?: RefundedPayment;
    reply_markup?: InlineKeyboardMarkup;
    reply_to_message?: ReplyMessage;
    reply_to_story?: Story;
    sender_boost_count?: number;
    sender_business_bot?: User;
    sender_chat?: Chat;
    show_caption_above_media?: true;
    sticker?: Sticker;
    story?: Story;
    successful_payment?: SuccessfulPayment;
    supergroup_chat_created?: true;
    text?: string;
    users_shared?: UsersShared;
    venue?: Venue;
    via_bot?: User;
    video?: Video;
    video_chat_ended?: VideoChatEnded;
    video_chat_participants_invited?: VideoChatParticipantsInvited;
    video_chat_scheduled?: VideoChatScheduled;
    video_chat_started?: VideoChatStarted;
    video_note?: VideoNote;
    voice?: Voice;
    web_app_data?: WebAppData;
    write_access_allowed?: WriteAccessAllowed;
}

Hierarchy (view full)

Properties

animation?: Animation

Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set

audio?: Audio

Message is an audio file, information about the file

author_signature?: string

Signature of the post author for messages in channels, or the custom title of an anonymous group administrator

boost_added?: ChatBoostAdded

Service message: user boosted the chat

business_connection_id?: string

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.

caption?: string

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

caption_entities?: MessageEntity[]

For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption

channel_chat_created?: true

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 reply_to_message if someone replies to a very first message in a channel.

chat: Chat

Chat the message belongs to

chat_background_set?: ChatBackground
chat_shared?: ChatShared

Service message: a chat was shared with the bot

connected_website?: string

The domain name of the website on which the user has logged in. More about Telegram Login »

contact?: Contact

Message is a shared contact, information about the contact

date: number

Date the message was sent in Unix time. It is always a positive number, representing a valid date.

delete_chat_photo?: true

Service message: the chat photo was deleted

dice?: Dice

Message is a dice with random value

document?: Document

Message is a general file, information about the file

edit_date?: number

Date the message was last edited in Unix time

effect_id?: string

Unique identifier of the message effect added to the message

entities?: MessageEntity[]

For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text

external_reply?: ExternalReplyInfo

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

forum_topic_closed?: ForumTopicClosed

Service message: forum topic closed

forum_topic_created?: ForumTopicCreated

Service message: forum topic created

forum_topic_edited?: ForumTopicEdited

Service message: forum topic edited

forum_topic_reopened?: ForumTopicReopened

Service message: forum topic reopened

forward_origin?: MessageOrigin

Information about the original message for forwarded messages

from?: User

Sender of the message; may be empty for messages sent to channels. For backward compatibility, if the message was sent on behalf of a chat, the field contains a fake sender user in non-channel chats

game?: Game

Message is a game, information about the game. More about games »

general_forum_topic_hidden?: GeneralForumTopicHidden

Service message: the 'General' forum topic hidden

general_forum_topic_unhidden?: GeneralForumTopicUnhidden

Service message: the 'General' forum topic unhidden

giveaway?: Giveaway

The message is a scheduled giveaway message

giveaway_completed?: GiveawayCompleted

Service message: a giveaway without public winners was completed

giveaway_created?: GiveawayCreated

Service message: a scheduled giveaway was created

giveaway_winners?: GiveawayWinners

A giveaway with public winners was completed

group_chat_created?: true

Service message: the group has been created

has_media_spoiler?: true

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

has_protected_content?: true

True, if the message can't be forwarded

invoice?: Invoice

Message is an invoice for a payment, information about the invoice. More about payments »

is_automatic_forward?: true

True, if the message is a channel post that was automatically forwarded to the connected discussion group

is_from_offline?: true

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

is_topic_message?: boolean

True, if the message is sent to a forum topic

left_chat_member?: User

A member was removed from the group, information about them (this member may be the bot itself)

link_preview_options?: LinkPreviewOptions

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

location?: Location

Message is a shared location, information about the location

media_group_id?: string

The unique identifier of a media message group this message belongs to

message_auto_delete_timer_changed?: MessageAutoDeleteTimerChanged

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

message_id: number

Unique message identifier inside this chat

message_thread_id?: number

Unique identifier of a message thread or a forum topic to which the message belongs; for supergroups only

migrate_from_chat_id?: number

The supergroup has been migrated from a group with the specified identifier.

migrate_to_chat_id?: number

The group has been migrated to a supergroup with the specified identifier.

new_chat_members?: User[]

New members that were added to the group or supergroup and information about them (the bot itself may be one of these members)

new_chat_photo?: PhotoSize[]

A chat photo was change to this value

new_chat_title?: string

A chat title was changed to this value

paid_media?: PaidMediaInfo

Message contains paid media; information about the paid media

passport_data?: PassportData

Telegram Passport data

photo?: PhotoSize[]

Message is a photo, available sizes of the photo

pinned_message?: MaybeInaccessibleMessage

Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.

poll?: Poll

Message is a native poll, information about the poll

proximity_alert_triggered?: ProximityAlertTriggered

Service message. A user in the chat triggered another user's proximity alert while sharing Live Location.

quote?: TextQuote

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

refunded_payment?: RefundedPayment

Message is a service message about a refunded payment, information about the payment. More about payments »

reply_markup?: InlineKeyboardMarkup

Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons.

reply_to_message?: ReplyMessage

For replies in the same chat and message thread, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.

reply_to_story?: Story

For replies to a story, the original message

sender_boost_count?: number

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

sender_business_bot?: User

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.

sender_chat?: Chat

Sender of the message when sent on behalf of a chat. For example, the supergroup itself for messages sent by its anonymous administrators or a linked channel for messages automatically forwarded to the channel's discussion group. For backward compatibility, if the message was sent on behalf of a chat, the field from contains a fake sender user in non-channel chats.

show_caption_above_media?: true

True, if the caption must be shown above the message media

sticker?: Sticker

Message is a sticker, information about the sticker

story?: Story

Message is a forwarded story

successful_payment?: SuccessfulPayment

Message is a service message about a successful payment, information about the payment. More about payments »

supergroup_chat_created?: true

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 reply_to_message if someone replies to a very first message in a directly created supergroup.

text?: string

For text messages, the actual UTF-8 text of the message

users_shared?: UsersShared

Service message: users were shared with the bot

venue?: Venue

Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set

via_bot?: User

Bot through which the message was sent

video?: Video

Message is a video, information about the video

video_chat_ended?: VideoChatEnded

Service message: video chat ended

video_chat_participants_invited?: VideoChatParticipantsInvited

Service message: new participants invited to a video chat

video_chat_scheduled?: VideoChatScheduled

Service message: video chat scheduled

video_chat_started?: VideoChatStarted

Service message: video chat started

video_note?: VideoNote

Message is a video note, information about the video message

voice?: Voice

Message is a voice message, information about the file

web_app_data?: WebAppData

Service message: data sent by a Web App

write_access_allowed?: WriteAccessAllowed

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