Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Message

Hierarchy

Index

Properties

CONSTRUCTOR_ID: 508332649
SUBCLASS_OF_ID: 2030045667
classType: "request"
className: "Message"
_chatPeer?: EntityLike
_inputChat?: EntityLike
_chat?: Entity
_broadcast?: boolean
CONSTRUCTOR_ID: number
SUBCLASS_OF_ID: number
out?: boolean

Whether the message is outgoing (i.e. you sent it from another session) or incoming (i.e. someone else sent it).
Note that messages in your own chat are always incoming, but this member will be true if you send a message to your own chat. Messages you forward to your chat are not considered outgoing, just like official clients display them.

mentioned?: boolean

Whether you were mentioned in this message or not. Note that replies to your own messages also count as mentions.

mediaUnread?: boolean

Whether you have read the media in this message or not, e.g. listened to the voice note media.

silent?: boolean

Whether the message should notify people with sound or not. Previously used in channels, but since 9 August 2019, it can also be used in private chats

post?: boolean

Whether this message is a post in a broadcast channel or not.

fromScheduled?: boolean

Whether this message was originated from a previously-scheduled message or not.

legacy?: boolean

Whether this is a legacy message or not.

editHide?: boolean

Whether the edited mark of this message is edited should be hidden (e.g. in GUI clients) or shown.

pinned?: boolean

Whether this message is currently pinned or not.

id: number

The ID of this message. This field is always present. Any other member is optional and may be undefined.

fromId?: TypePeer

The peer who sent this message, which is either Api.PeerUser, Api.PeerChat or Api.PeerChannel. This value will be undefined for anonymous messages.

peerId: TypePeer

The peer to which this message was sent, which is either Api.PeerUser, Api.PeerChat or Api.PeerChannel. This will always be present except for empty messages.

The original forward header if this message is a forward. You should probably use the forward property instead.

viaBotId?: BigInteger

The ID of the bot used to send this message through its inline mode (e.g. "via @like").

The original reply header if this message is replying to another.

date: number

The timestamp indicating when this message was sent. This will always be present except for empty messages.

message: string

The string text of the message for Api.Message instances, which will be undefined for other types of messages.

The media sent with this message if any (such as photos, videos, documents, gifs, stickers, etc.).

You may want to access the photo, document etc. properties instead.

If the media was not present or it was Api.MessageMediaEmpty, this member will instead be undefined for convenience.

replyMarkup?: TypeReplyMarkup

The reply markup for this message (which was sent either via a bot or by a bot). You probably want to access buttons instead.

entities?: TypeMessageEntity[]

The list of markup entities in this message, such as bold, italics, code, hyperlinks, etc.

views?: number

The number of views this message from a broadcast channel has. This is also present in forwards.

forwards?: number

The number of times this message has been forwarded.

replies?: MessageReplies

The number of times another message has replied to this message.

editDate?: number

The date when this message was last edited.

postAuthor?: string

The display name of the message sender to show in messages sent to broadcast channels.

groupedId?: BigInteger

If this message belongs to a group of messages (photo albums or video albums), all of them will have the same value here.

restrictionReason?: RestrictionReason[]

An optional list of reasons why this message was restricted. If the list is undefined, this message has not been restricted.

The message action object of the message for Api.MessageService instances, which will be undefined for other types of messages.

ttlPeriod?: number

The Time To Live period configured for this message. The message should be erased from wherever it's stored (memory, a local database, etc.) when this threshold is met.

reactions?: MessageReactions
noforwards?: boolean
originalArgs: any
patternMatch?: RegExpMatchArray
_senderId?: BigInteger

Methods

  • getChat(): Promise<undefined | Entity>
  • _refetchChat(): Promise<void>
  • [custom](): {}
  • _refetchSender(): Promise<void>
  • getEntitiesText(cls?: Function): any
  • getReplyMessage(): Promise<undefined | Message>
  • delete(__namedParameters?: { revoke: boolean }): Promise<undefined | AffectedMessages[]>
  • markAsRead(): Promise<undefined | boolean>
  • _neededMarkupBot(): any
  • Returns the input peer of the bot that's needed for the reply markup.

    This is necessary for KeyboardButtonSwitchInline since we need to know what bot we want to start. Raises Error if the bot cannot be found but is needed. Returns None if it's not needed.

    Returns any

  • _documentByAttribute(kind: Function, condition?: Function): undefined | Document
  • getSender(): Promise<undefined | Entity>

Accessors

  • get chat(): undefined | Entity
  • get chatId(): undefined | BigInteger
  • get isPrivate(): undefined | boolean
  • get isGroup(): undefined | boolean
  • get isChannel(): boolean
  • get text(): string
  • set text(value: string): void
  • get rawText(): string
  • set rawText(value: string): void
  • get isReply(): boolean
  • get buttonCount(): number
  • get game(): undefined | Game
  • get actionEntities(): any
  • get replyToMsgId(): undefined | number
  • get sender(): undefined | Entity
  • get senderId(): undefined | BigInteger

Constructors

Generated using TypeDoc