Update about a new or edited business message.

Hierarchy (View Summary)

Constructors

Properties

_peers: PeersIndex
isScheduled: boolean = false

Whether the message is scheduled. If it is, then its date is set to future.

Raw TL object.

Accessors

  • get action(): MessageAction
  • Message action. null for non-service messages or for unsupported events.

    For unsupported events, use .raw.action directly.

    Returns MessageAction

  • get canBeForwarded(): boolean
  • Whether this message can be forwarded

    false for service mesasges and private restricted chats/chanenls

    Returns boolean

  • get canBeReacted(): boolean
  • Whether reactions are possible on this message

    Note: for non-service message this is always true, regardless if the message can actually be reacted to.

    Returns boolean

  • get chat(): Peer
  • Conversation the message belongs to

    Returns Peer

  • get connectionId(): string
  • Unique identifier of the business connection from which the message was received.

    Returns string

  • get date(): Date
  • Date when the message was sent

    Returns Date

  • get editDate(): null | Date
  • Date when the message was last edited

    Returns null | Date

  • get effectId(): null | Long
  • If this message was sent with a message effect, ID of the effect

    Returns null | Long

  • get entities(): readonly MessageEntity[]
  • Message text/caption entities (may be empty)

    Returns readonly MessageEntity[]

  • get factCheck(): null | FactCheck
  • Information about fact-check added to the message, if any

    Returns null | FactCheck

  • get forward(): null | MessageForwardInfo
  • If this message is a forward, contains info about it.

    Returns null | MessageForwardInfo

  • get forwards(): null | number
  • For channel posts, number of forwards

    null for service messages and non-post messages, or if the current user is not an admin in the channel

    Returns null | number

  • get groupedId(): null | Long
  • Multiple media messages with the same grouped ID indicate an album or media group

    null for service messages and non-grouped messages

    Returns null | Long

  • get groupedIdUnique(): null | string
  • Same as groupedId, but is globally unique across chats.

    Returns null | string

  • get hasUnreadMedia(): boolean
  • Whether there are unread media attachments in this message

    Returns boolean

  • get hideEditMark(): boolean
  • Whether the message should be considered unedited, even if editDate ≠ null

    Returns boolean

  • get id(): number
  • Unique message identifier inside this chat

    Returns number

  • get invertMedia(): boolean
  • If set, any eventual webpage preview should be shown on top of the message instead of at the bottom.

    Returns boolean

  • get isAutomaticForward(): boolean
  • Whether the message is a channel post that was automatically forwarded to the connected discussion group

    Returns boolean

  • get isChannelPost(): boolean
  • Whether this is a broadcast channel post

    Returns boolean

  • get isContentProtected(): boolean
  • Whether this message has content protection (i.e. disabled forwards)

    Returns boolean

  • get isForwardedPremiumMedia(): boolean
  • Whether this is a premium media (e.g. >2gb file or fullscreen sticker) that was forwarded without author by a non-premium user

    Returns boolean

  • get 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

    Returns boolean

  • get isFromScheduled(): boolean
  • Whether this message was automatically sent from a scheduled message.

    Note: for messages sent by other users, this is always false.

    Returns boolean

  • get isMention(): boolean
  • Whether this message contains mention of the current user

    Returns boolean

  • get isOutgoing(): boolean
  • Whether the message is incoming or outgoing:

    • Messages received from other chats are incoming (outgoing = false)
    • Messages sent by you to other chats are outgoing (outgoing = true)
    • Messages to yourself (i.e. Saved Messages) are incoming (outgoing = false)

    Returns boolean

  • get isPinned(): boolean
  • Whether the message is pinned in the current chat

    Returns boolean

  • get isService(): boolean
  • Whether this message is a service message

    Returns boolean

  • get isSilent(): boolean
  • Whether this is a silent message (no notification triggered)

    Returns boolean

  • get isTopicMessage(): boolean
  • Whether this message is in a forum topic

    Returns boolean

  • Generated permalink to this message, only for groups and channels

    Returns string

    MtArgumentError In case the chat does not support message links

  • get markup(): null | ReplyMarkup
  • Reply markup provided with this message, if any.

    Returns null | ReplyMarkup

  • get media(): MessageMedia
  • Message media. null for text-only and service messages and for unsupported media types.

    For unsupported media types, use .raw.media directly.

    Returns MessageMedia

  • get quickReplyShortcutId(): null | number
  • If non-null, this message is not actually sent, and is instead inside a group of "quick reply" messages under the given shortcut ID

    Returns null | number

  • get reactions(): null | MessageReactions
  • Reactions added to this message, if any

    Returns null | MessageReactions

  • get replies(): null | MessageRepliesInfo
  • Information about comments (for channels) or replies (for groups)

    Returns null | MessageRepliesInfo

  • get replyTo(): null | Message
  • The replied message (if any)

    Returns null | Message

  • get replyToMessage(): null | RepliedMessageInfo
  • For replies, information about the that is being replied to.

    Mutually exclusive with replyToStory

    Returns null | RepliedMessageInfo

  • get sender(): Peer
  • Message sender.

    Usually is a User, but can be a Peer in case the message was sent by an anonymous admin, anonymous premium user, or if the message is a forwarded channel post.

    If the message was sent by an anonymous admin, sender will equal to chat.

    If the message is a forwarded channel post, sender is the channel itself.

    Returns Peer

  • get senderBoostCount(): number
  • Number of boosts applied to this chat by the sender

    Returns number

  • get signature(): null | string
  • For channel posts with signatures enabled, name of the post author

    Returns null | string

  • get text(): string
  • Message text or media caption.

    Empty string for service messages (you should handle i18n yourself)

    Returns string

  • get textWithEntities(): TextWithEntities
  • Returns TextWithEntities

  • get ttlPeriod(): null | number
  • TTL period of the message, in seconds.

    Returns null | number

  • get viaBot(): null | User
  • If this message is generated from an inline query, information about the bot which generated it

    Returns null | User

  • get viaBusinessBot(): null | User
  • If this message was sent by a business bot on behalf of sender, information about the business bot.

    Note: only available to the business account and the bot itself.

    Returns null | User

  • get videoProcessingPending(): boolean
  • Whether this message has a video that is still being processed

    Returns boolean

  • get views(): null | number
  • For channel posts, number of views

    null for service messages and non-post messages.

    Returns null | number