Message

data class Message(messageId: Int, from: User?, senderChat: Chat?, date: Int, chat: Chat, forwardFrom: User?, forwardFromChat: Chat?, forwardFromMessageId: Int?, forwardSignature: String?, forwardSenderName: String?, forwardDate: Int?, replyToMessage: Message?, viaBot: User?, editDate: Int?, mediaGroupId: String?, authorSignature: String?, text: String?, entities: List<MessageEntity>, animation: Animation?, audio: Audio?, document: Document?, photo: List<PhotoSize>, sticker: Sticker?, video: Video?, videoNote: VideoNote?, voice: Voice?, caption: String?, captionEntities: List<MessageEntity>, contact: Contact?, dice: Dice?, game: Game?, poll: Poll?, venue: Venue?, location: Location?, newChatMembers: List<User>, leftChatMember: User?, newChatTitle: String?, newChatPhoto: List<PhotoSize>, deleteChatPhoto: Boolean, groupChatCreated: Boolean, supergroupChatCreated: Boolean, channelChatCreated: Boolean, migrateToChatId: Int?, migrateFromChatId: Int?, pinnedMessage: Message?, invoice: Invoice?, successfulPayment: SuccessfulPayment?, connectedWebsite: String?, passportData: PassportData?, proximityAlertTriggered: ProximityAlertTriggered?, replyMarkup: InlineKeyboardMarkup?)

This object represents a message.

Parameters

messageId

Unique message identifier inside this chat

from

Optional. Sender, empty for messages sent to channels

senderChat

Optional. Sender of the message, sent on behalf of a chat. The channel itself for channel messages. The supergroup itself for messages from anonymous group administrators. The linked channel for messages automatically forwarded to the discussion group

date

Date the message was sent in Unix time

chat

Conversation the message belongs to

forwardFrom

Optional. For forwarded messages, sender of the original message

forwardFromChat

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

forwardFromMessageId

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

forwardSignature

Optional. For messages forwarded from channels, signature of the post author if present

forwardSenderName

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

forwardDate

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

replyToMessage

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

viaBot

Optional. Bot through which the message was sent

editDate

Optional. Date the message was last edited in Unix time

mediaGroupId

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

authorSignature

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

text

Optional. For text messages, the actual UTF-8 text of the message, 0-4096 characters

entities

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

animation

Optional. Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set

audio

Optional. Message is an audio file, information about the file

document

Optional. Message is a general file, information about the file

photo

Optional. Message is a photo, available sizes of the photo

sticker

Optional. Message is a sticker, information about the sticker

video

Optional. Message is a video, information about the video

videoNote

Optional. Message is a video note, information about the video message

voice

Optional. Message is a voice message, information about the file

caption

Optional. Caption for the animation, audio, document, photo, video or voice, 0-1024 characters

captionEntities

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

contact

Optional. Message is a shared contact, information about the contact

dice

Optional. Message is a dice with random value

game

Optional. Message is a game, information about the game. More about games »

poll

Optional. Message is a native poll, information about the poll

venue

Optional. Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set

location

Optional. Message is a shared location, information about the location

newChatMembers

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

leftChatMember

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

newChatTitle

Optional. A chat title was changed to this value

newChatPhoto

Optional. A chat photo was change to this value

deleteChatPhoto

Optional. Service message: the chat photo was deleted

groupChatCreated

Optional. Service message: the group has been created

supergroupChatCreated

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

channelChatCreated

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

migrateToChatId

Optional. The group has been migrated to a supergroup with the specified identifier. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.

migrateFromChatId

Optional. The supergroup has been migrated from a group with the specified identifier. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.

pinnedMessage

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

invoice

Optional. Message is an invoice for a payment, information about the invoice. More about payments »

successfulPayment

Optional. Message is a service message about a successful payment, information about the payment. More about payments »

connectedWebsite

Optional. The domain name of the website on which the user has logged in. More about Telegram Login »

passportData

Optional. Telegram Passport data

proximityAlertTriggered

Optional. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location.

replyMarkup

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

Constructors

Message
Link copied to clipboard
common
fun Message(messageId: Int, from: User? = null, senderChat: Chat? = null, date: Int, chat: Chat, forwardFrom: User? = null, forwardFromChat: Chat? = null, forwardFromMessageId: Int? = null, forwardSignature: String? = null, forwardSenderName: String? = null, forwardDate: Int? = null, replyToMessage: Message? = null, viaBot: User? = null, editDate: Int? = null, mediaGroupId: String? = null, authorSignature: String? = null, text: String? = null, entities: List<MessageEntity> = emptyList(), animation: Animation? = null, audio: Audio? = null, document: Document? = null, photo: List<PhotoSize> = emptyList(), sticker: Sticker? = null, video: Video? = null, videoNote: VideoNote? = null, voice: Voice? = null, caption: String? = null, captionEntities: List<MessageEntity> = emptyList(), contact: Contact? = null, dice: Dice? = null, game: Game? = null, poll: Poll? = null, venue: Venue? = null, location: Location? = null, newChatMembers: List<User> = emptyList(), leftChatMember: User? = null, newChatTitle: String? = null, newChatPhoto: List<PhotoSize> = emptyList(), deleteChatPhoto: Boolean = true, groupChatCreated: Boolean = true, supergroupChatCreated: Boolean = true, channelChatCreated: Boolean = true, migrateToChatId: Int? = null, migrateFromChatId: Int? = null, pinnedMessage: Message? = null, invoice: Invoice? = null, successfulPayment: SuccessfulPayment? = null, connectedWebsite: String? = null, passportData: PassportData? = null, proximityAlertTriggered: ProximityAlertTriggered? = null, replyMarkup: InlineKeyboardMarkup? = null)
Unique message identifier inside this chat

Functions

component1
Link copied to clipboard
common
operator fun component1(): Int
component10
Link copied to clipboard
common
operator fun component10(): String?
component11
Link copied to clipboard
common
operator fun component11(): Int?
component12
Link copied to clipboard
common
operator fun component12(): Message?
component13
Link copied to clipboard
common
operator fun component13(): User?
component14
Link copied to clipboard
common
operator fun component14(): Int?
component15
Link copied to clipboard
common
operator fun component15(): String?
component16
Link copied to clipboard
common
operator fun component16(): String?
component17
Link copied to clipboard
common
operator fun component17(): String?
component18
Link copied to clipboard
common
operator fun component18(): List<MessageEntity>
component19
Link copied to clipboard
common
operator fun component19(): Animation?
component2
Link copied to clipboard
common
operator fun component2(): User?
component20
Link copied to clipboard
common
operator fun component20(): Audio?
component21
Link copied to clipboard
common
operator fun component21(): Document?
component22
Link copied to clipboard
common
operator fun component22(): List<PhotoSize>
component23
Link copied to clipboard
common
operator fun component23(): Sticker?
component24
Link copied to clipboard
common
operator fun component24(): Video?
component25
Link copied to clipboard
common
operator fun component25(): VideoNote?
component26
Link copied to clipboard
common
operator fun component26(): Voice?
component27
Link copied to clipboard
common
operator fun component27(): String?
component28
Link copied to clipboard
common
operator fun component28(): List<MessageEntity>
component29
Link copied to clipboard
common
operator fun component29(): Contact?
component3
Link copied to clipboard
common
operator fun component3(): Chat?
component30
Link copied to clipboard
common
operator fun component30(): Dice?
component31
Link copied to clipboard
common
operator fun component31(): Game?
component32
Link copied to clipboard
common
operator fun component32(): Poll?
component33
Link copied to clipboard
common
operator fun component33(): Venue?
component34
Link copied to clipboard
common
operator fun component34(): Location?
component35
Link copied to clipboard
common
operator fun component35(): List<User>
component36
Link copied to clipboard
common
operator fun component36(): User?
component37
Link copied to clipboard
common
operator fun component37(): String?
component38
Link copied to clipboard
common
operator fun component38(): List<PhotoSize>
component39
Link copied to clipboard
common
operator fun component39(): Boolean
component4
Link copied to clipboard
common
operator fun component4(): Int
component40
Link copied to clipboard
common
operator fun component40(): Boolean
component41
Link copied to clipboard
common
operator fun component41(): Boolean
component42
Link copied to clipboard
common
operator fun component42(): Boolean
component43
Link copied to clipboard
common
operator fun component43(): Int?
component44
Link copied to clipboard
common
operator fun component44(): Int?
component45
Link copied to clipboard
common
operator fun component45(): Message?
component46
Link copied to clipboard
common
operator fun component46(): Invoice?
component47
Link copied to clipboard
common
operator fun component47(): SuccessfulPayment?
component48
Link copied to clipboard
common
operator fun component48(): String?
component49
Link copied to clipboard
common
operator fun component49(): PassportData?
component5
Link copied to clipboard
common
operator fun component5(): Chat
component50
Link copied to clipboard
common
operator fun component50(): ProximityAlertTriggered?
component51
Link copied to clipboard
common
operator fun component51(): InlineKeyboardMarkup?
component6
Link copied to clipboard
common
operator fun component6(): User?
component7
Link copied to clipboard
common
operator fun component7(): Chat?
component8
Link copied to clipboard
common
operator fun component8(): Int?
component9
Link copied to clipboard
common
operator fun component9(): String?
copy
Link copied to clipboard
common
fun copy(messageId: Int, from: User? = null, senderChat: Chat? = null, date: Int, chat: Chat, forwardFrom: User? = null, forwardFromChat: Chat? = null, forwardFromMessageId: Int? = null, forwardSignature: String? = null, forwardSenderName: String? = null, forwardDate: Int? = null, replyToMessage: Message? = null, viaBot: User? = null, editDate: Int? = null, mediaGroupId: String? = null, authorSignature: String? = null, text: String? = null, entities: List<MessageEntity> = emptyList(), animation: Animation? = null, audio: Audio? = null, document: Document? = null, photo: List<PhotoSize> = emptyList(), sticker: Sticker? = null, video: Video? = null, videoNote: VideoNote? = null, voice: Voice? = null, caption: String? = null, captionEntities: List<MessageEntity> = emptyList(), contact: Contact? = null, dice: Dice? = null, game: Game? = null, poll: Poll? = null, venue: Venue? = null, location: Location? = null, newChatMembers: List<User> = emptyList(), leftChatMember: User? = null, newChatTitle: String? = null, newChatPhoto: List<PhotoSize> = emptyList(), deleteChatPhoto: Boolean = true, groupChatCreated: Boolean = true, supergroupChatCreated: Boolean = true, channelChatCreated: Boolean = true, migrateToChatId: Int? = null, migrateFromChatId: Int? = null, pinnedMessage: Message? = null, invoice: Invoice? = null, successfulPayment: SuccessfulPayment? = null, connectedWebsite: String? = null, passportData: PassportData? = null, proximityAlertTriggered: ProximityAlertTriggered? = null, replyMarkup: InlineKeyboardMarkup? = null): Message
equals
Link copied to clipboard
common
open operator override fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
common
open override fun hashCode(): Int
toString
Link copied to clipboard
common
open override fun toString(): String

Properties

animation
Link copied to clipboard
common
val animation: Animation? = null
Optional.
audio
Link copied to clipboard
common
val audio: Audio? = null
Optional.
authorSignature
Link copied to clipboard
common
val authorSignature: String? = null
Optional.
caption
Link copied to clipboard
common
val caption: String? = null
Optional.
captionEntities
Link copied to clipboard
common
val captionEntities: List<MessageEntity>
Optional.
channelChatCreated
Link copied to clipboard
common
val channelChatCreated: Boolean = true
Optional.
chat
Link copied to clipboard
common
val chat: Chat
Conversation the message belongs to
connectedWebsite
Link copied to clipboard
common
val connectedWebsite: String? = null
Optional.
contact
Link copied to clipboard
common
val contact: Contact? = null
Optional.
date
Link copied to clipboard
common
val date: Int
Date the message was sent in Unix time
deleteChatPhoto
Link copied to clipboard
common
val deleteChatPhoto: Boolean = true
Optional.
dice
Link copied to clipboard
common
val dice: Dice? = null
Optional.
document
Link copied to clipboard
common
val document: Document? = null
Optional.
editDate
Link copied to clipboard
common
val editDate: Int? = null
Optional.
entities
Link copied to clipboard
common
val entities: List<MessageEntity>
Optional.
forwardDate
Link copied to clipboard
common
val forwardDate: Int? = null
Optional.
forwardFrom
Link copied to clipboard
common
val forwardFrom: User? = null
Optional.
forwardFromChat
Link copied to clipboard
common
val forwardFromChat: Chat? = null
Optional.
forwardFromMessageId
Link copied to clipboard
common
val forwardFromMessageId: Int? = null
Optional.
forwardSenderName
Link copied to clipboard
common
val forwardSenderName: String? = null
Optional.
forwardSignature
Link copied to clipboard
common
val forwardSignature: String? = null
Optional.
from
Link copied to clipboard
common
val from: User? = null
Optional.
game
Link copied to clipboard
common
val game: Game? = null
Optional.
groupChatCreated
Link copied to clipboard
common
val groupChatCreated: Boolean = true
Optional.
invoice
Link copied to clipboard
common
val invoice: Invoice? = null
Optional.
leftChatMember
Link copied to clipboard
common
val leftChatMember: User? = null
Optional.
location
Link copied to clipboard
common
val location: Location? = null
Optional.
mediaGroupId
Link copied to clipboard
common
val mediaGroupId: String? = null
Optional.
messageId
Link copied to clipboard
common
val messageId: Int
Unique message identifier inside this chat
migrateFromChatId
Link copied to clipboard
common
val migrateFromChatId: Int? = null
Optional.
migrateToChatId
Link copied to clipboard
common
val migrateToChatId: Int? = null
Optional.
newChatMembers
Link copied to clipboard
common
val newChatMembers: List<User>
Optional.
newChatPhoto
Link copied to clipboard
common
val newChatPhoto: List<PhotoSize>
Optional.
newChatTitle
Link copied to clipboard
common
val newChatTitle: String? = null
Optional.
passportData
Link copied to clipboard
common
val passportData: PassportData? = null
Optional.
photo
Link copied to clipboard
common
val photo: List<PhotoSize>
Optional.
pinnedMessage
Link copied to clipboard
common
val pinnedMessage: Message? = null
Optional.
poll
Link copied to clipboard
common
val poll: Poll? = null
Optional.
proximityAlertTriggered
Link copied to clipboard
common
val proximityAlertTriggered: ProximityAlertTriggered? = null
Optional.
replyMarkup
Link copied to clipboard
common
val replyMarkup: InlineKeyboardMarkup? = null
Optional.
replyToMessage
Link copied to clipboard
common
val replyToMessage: Message? = null
Optional.
senderChat
Link copied to clipboard
common
val senderChat: Chat? = null
Optional.
sticker
Link copied to clipboard
common
val sticker: Sticker? = null
Optional.
successfulPayment
Link copied to clipboard
common
val successfulPayment: SuccessfulPayment? = null
Optional.
supergroupChatCreated
Link copied to clipboard
common
val supergroupChatCreated: Boolean = true
Optional.
text
Link copied to clipboard
common
val text: String? = null
Optional.
venue
Link copied to clipboard
common
val venue: Venue? = null
Optional.
viaBot
Link copied to clipboard
common
val viaBot: User? = null
Optional.
video
Link copied to clipboard
common
val video: Video? = null
Optional.
videoNote
Link copied to clipboard
common
val videoNote: VideoNote? = null
Optional.
voice
Link copied to clipboard
common
val voice: Voice? = null
Optional.