TgKit library and website are still in early development!

Message Class

extends Base

Represents a message

Properties

animation Animation

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

See the code

audio Audio

Message is an audio file, information about the file

See the code

authorSignature string

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

See the code

boostAdded ChatBoostAdded

See the code

businessConnectionId 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.

See the code

caption string

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

See the code

captionEntities

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

See the code

channelChatCreated boolean

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 supergroup when it is created. It can only be found in

See the code

chat Chat

Conversation the message belongs to

See the code

chatBackgroundSet any

See the code

chatShared ChatShared

See the code

client Client

See the code

connectedWebsite string

The domain name of the website on which the user has logged in

See the code

contact Contact

Message is a shared contact, information about the contact

See the code

date Date

Date the message was sent

See the code

deleteChatPhoto boolean

Service message. The chat photo was deleted

See the code

dice Dice

Message is a dice with random value

See the code

document Document

Message is a general file, information about the file

See the code

editDate Date

Date the message was last edited

See the code

effectId string

Unique identifier of the message effect added to the message

See the code

entities

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

See the code

externalReply ExternalReplyInfo

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

See the code

forumTopicClosed ForumTopicClosed

See the code

forumTopicCreated ForumTopicCreated

See the code

forumTopicEdited ForumTopicEdited

See the code

forumTopicReopened ForumTopicReopened

See the code

forwardOrigin MessageOrigin

Information about the original message for forwarded messages

See the code

game Game

Message is a game, information about the game.

See the code

generalForumTopicHidden GeneralForumTopicHidden

See the code

generalForumTopicUnhidden GeneralForumTopicUnhidden

See the code

giveaway Giveaway

See the code

giveawayCompleted GiveawayCompleted

See the code

giveawayCreated GiveawayCreated

See the code

giveawayWinners GiveawayWinners

See the code

groupChatCreated boolean

Service message. The group has been created

See the code

hasMediaSpoiler boolean

*true*, if the message media is covered by a spoiler animation

See the code

hasProtectedContent boolean

*true*, if the message can't be forwarded

See the code

id number

Unique message identifier inside this chat

See the code

invoice Invoice

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

See the code

isAutomaticForward boolean

Whether the message is a channel post that was automatically forwarded to the connected discussion group

See the code

isFromOffline boolean

Whether the message was sent by an implicit action, for example, as an away or a greeting business message, or as a scheduled message

See the code

isTopicMessage boolean

Whether the message is sent to a forum topic

See the code

leftChatMember

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

See the code

linkPreviewOptions LinkPreviewOptions

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

See the code

location Location

Message is a location, information about the location

See the code

mediaGroupId string

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

See the code

messageAutoDeleteTimerChanged MessageAutoDeleteTimerChanged

See the code

migrateFromChatId number

See the code

migrateToChatId number

See the code

newChatMembers

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

See the code

newChatPhoto

Service message. A chat photo was change to this value

See the code

newChatTitle string

Service message. A chat title was changed to this value

See the code

paidMedia PaidMediaInfo

Message contains paid media; information about the paid media

See the code

passportData any

See the code

photo

Message is a photo, available sizes of the photo

See the code

pinnedMessage Message

Specified message was pinned.

See the code

poll Poll

Message is a native poll, information about the poll

See the code

proximityAlertTriggered ProximityAlertTriggered

See the code

quote TextQuote

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

See the code

replyMarkup InlineKeyboardMarkup

See the code

replyToMessage Message

For replies in the same chat and message thread, the original message. Note that the Message in this field will not contain further

See the code

replyToStory Story

For replies to a story, the original story

See the code

sender User

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

See the code

senderBoostCount number

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

See the code

senderBusinessBot 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.

See the code

senderChat Chat

Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field

See the code

showCaptionAboveMedia boolean

*true*, if the caption must be shown above the message media

See the code

sticker Sticker

Message is a sticker, information about the sticker

See the code

story Story

Message is a forwarded story

See the code

successfulPayment SuccessfulPayment

See the code

superGroupChatCreated boolean

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

See the code

text string

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

See the code

threadId number

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

See the code

userShared User

See the code

venue Venue

Message is a venue, information about the venue. For backward compatibility, when this property is set, the

See the code

viaBot User

Bot through which the message was sent

See the code

video Video

Message is a video, information about the video

See the code

videoChatEnded VideoChatEnded

See the code

videoChatParticipantsInvited VideoChatParticipantsInvited

See the code

videoChatScheduled VideoChatScheduled

See the code

videoChatStarted VideoChatStarted

See the code

videoNote VideoNote

Message is a video note, information about the video message

See the code

voice Voice

Message is a voice message, information about the file

See the code

webAppData WebAppData

See the code

writeAccessAllowed WriteAccessAlowed

See the code

Methods

copy(chatId: ChatId, options: MessageCopyOptions): Promise

See the code

delete(): Promise

See the code

editCaption(caption: undefined, options: MessageEditCaptionOptions): Promise

See the code

editMedia(media: InputMedia, options: MessageEditMediaOptions): Promise

See the code

editReplyMarkup(markup: InlineKeyboardMarkup, options: MessageEditCaptionOptions): Promise

See the code

editText(text: string, options: MessageEditTextOptions): Promise

See the code

forward(chatId: ChatId, options: MessageForwardOptions): Promise

See the code

pin(options: ChatMessagePinOptions): Promise

See the code

setReaction(reaction: undefined, options: MessageReactionSetOptons): Promise

See the code

stopPoll(options: PollStopOptions): Promise

See the code

unpin(): Promise

See the code