Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/mtkruto/3_types.ts>Message

[WIP] Cross-runtime JavaScript library for building Telegram clients
Go to Latest
interface Message
Re-export
import { type Message } from "https://deno.land/x/mtkruto@0.1.130/3_types.ts";

This object represents a message.

Properties

out: boolean

Whether the message is outgoing

id: number

Unique message identifier inside this chat

optional
threadId: number

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

optional
from: 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.

optional
senderChat: ChatP

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 from contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.

date: Date

Date the message was sent in Unix time

chat: ChatP

Conversation the message belongs to

optional
forwardFrom: User

For forwarded messages, sender of the original message

optional
forwardFromChat: ChatP

For messages forwarded from channels or from anonymous administrators, information about the original sender chat

optional
forwardId: number

For messages forwarded from channels, identifier of the original message in the channel

optional
forwardSignature: string

For forwarded messages that were originally sent in channels or by an anonymous chat administrator, signature of the message sender if present

optional
forwardSenderName: string

Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages

optional
forwardDate: Date

For forwarded messages, date the original message was sent in Unix time

isTopicMessage: boolean

True, if the message is sent to a forum topic

optional
isAutomaticForward: boolean

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

optional
replyToMessage: Omit<Message, "replyToMessage">

For replies, 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.

optional
replyToMessageId: number
optional
viaBot: User

Bot through which the message was sent

optional
editDate: Date

Date the message was last edited in Unix time

optional
hasProtectedContent: boolean

True, if the message can't be forwarded

optional
mediaGroupId: string

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

optional
authorSignature: string

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

optional
text: string

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

optional
entities: MessageEntity[]

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

optional
caption: string

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

optional
captionEntities: MessageEntity[]

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

optional
hasMediaSpoiler: boolean

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

optional
views: number

View count for channel posts

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

optional
photo: Photo

Message is a photo, available sizes of the photo

optional
document: Document

Message is a general file, information about the file

optional
video: Video

Message is a video, information about the video

optional
sticker: Sticker

Message is a sticker, information about the sticker

optional
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

optional
voice: Voice

Message is a voice message, information about the file

optional
audio: Audio

Message is an audio file, information about the file

optional
dice: Dice

Message is a dice with random value

optional
videoNote: VideoNote

Message is a video note, information about the video message

optional
contact: Contact

Message is a shared contact, information about the contact

optional
game: Game

Message is a game, information about the game.

optional
poll: Poll

New poll state. Bots receive only updates about stopped polls and polls, which were sent by the bot.

optional
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

optional
location: Location

Message is a shared location, information about the location

optional
newChatMembers: User[]

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

optional
leftChatMember: User

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

optional
newChatTitle: string

A chat title was changed to this value

optional
newChatPhoto: Photo

A chat photo was change to this value

optional
deletedChatPhoto: true

Service message: the chat photo was deleted

optional
groupCreated: true

Service message: the group has been created

optional
supergroupCreated: 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.

optional
channelCreated: 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.

optional
messageAutoDeleteTimerChanged: { messageAutoDeleteTime: number; }

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

optional
chatMigratedTo: number

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

optional
chatMigratedFrom: number

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

optional
pinnedMessage: Message

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

optional
userShared: { requestId: number; userId: number; }

Service message: a user was shared with the bot

optional
writeAccessAllowed: { webAppName?: string; }

Service message: the user allowed the bot added to the attachment menu to write messages

optional
forumTopicCreated: { name: string; iconColor: string; iconCutsomEmojiId?: string; }

Service message: forum topic created

optional
forumTopicEdited: { name?: string; iconCutsomEmojiId?: string; }

Service message: forum topic edited

optional
forumTopicClosed: Record<never, never>

Service message: forum topic closed

optional
forumTopicReopened: Record<never, never>

Service message: forum topic reopened

optional
videoChatScheduled: { startDate: Date; }

Service message: video chat scheduled

optional
videoChatStarted: Record<never, never>

Service message: video chat started

optional
videoChatEnded: { duration: number; }

Service message: video chat ended