Td Api Message Content - OTR/Kotlin-Telegram-Client GitHub Wiki

Class TdApi.MessageContent

Description

Contains the content of a message. Abstract base class that have the following subclasses:

Reference

Class TdApi.MessageText

Represents a text message.

Properties

  • text : TdApi.FormattedText - A text of the message with some entities.
  • webPage : TdApi.WebPage - A preview of the web page that's mentioned in the text; may be null.

Reference

Generated docs for TdApi.MessageText

Generated docs for TdApi.FormattedText

Example

// This class is an abstract base class. Contains the content of a message.
val content: TdApi.MessageContent = message.content
when (content) {
    is TdApi.MessageText -> {
        // A preview of the web page that's mentioned in the text; may be null.
        val webPage: TdApi.WebPage = content.webPage
        // A text with some entities.
        val formattedText: TdApi.FormattedText = content.text
    }
}

References to other subclasses