Update

data class Update(updateId: Int, message: Message?, editedMessage: Message?, channelPost: Message?, editedChannelPost: Message?, inlineQuery: InlineQuery?, chosenInlineResult: ChosenInlineResult?, callbackQuery: CallbackQuery?, shippingQuery: ShippingQuery?, preCheckoutQuery: PreCheckoutQuery?, poll: Poll?, pollAnswer: PollAnswer?)

This object represents an incoming update. At most one of the optional parameters can be present in any given update.

Parameters

updateId

The update's unique identifier. Update identifiers start from a certain positive number and increase sequentially. This ID becomes especially handy if you're using Webhooks, since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order. If there are no new updates for at least a week, then identifier of the next update will be chosen randomly instead of sequentially.

message

Optional. New incoming message of any kind — text, photo, sticker, etc.

editedMessage

Optional. New version of a message that is known to the bot and was edited

channelPost

Optional. New incoming channel post of any kind — text, photo, sticker, etc.

editedChannelPost

Optional. New version of a channel post that is known to the bot and was edited

inlineQuery

Optional. New incoming inline query

chosenInlineResult

Optional. The result of an inline query that was chosen by a user and sent to their chat partner. Please see our documentation on the feedback collecting for details on how to enable these updates for your bot.

callbackQuery

Optional. New incoming callback query

shippingQuery

Optional. New incoming shipping query. Only for invoices with flexible price

preCheckoutQuery

Optional. New incoming pre-checkout query. Contains full information about checkout

poll

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

pollAnswer

Optional. A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself.

Constructors

Update
Link copied to clipboard
common
fun Update(updateId: Int, message: Message? = null, editedMessage: Message? = null, channelPost: Message? = null, editedChannelPost: Message? = null, inlineQuery: InlineQuery? = null, chosenInlineResult: ChosenInlineResult? = null, callbackQuery: CallbackQuery? = null, shippingQuery: ShippingQuery? = null, preCheckoutQuery: PreCheckoutQuery? = null, poll: Poll? = null, pollAnswer: PollAnswer? = null)
The update's unique identifier.

Functions

component1
Link copied to clipboard
common
operator fun component1(): Int
component10
Link copied to clipboard
common
operator fun component10(): PreCheckoutQuery?
component11
Link copied to clipboard
common
operator fun component11(): Poll?
component12
Link copied to clipboard
common
operator fun component12(): PollAnswer?
component2
Link copied to clipboard
common
operator fun component2(): Message?
component3
Link copied to clipboard
common
operator fun component3(): Message?
component4
Link copied to clipboard
common
operator fun component4(): Message?
component5
Link copied to clipboard
common
operator fun component5(): Message?
component6
Link copied to clipboard
common
operator fun component6(): InlineQuery?
component7
Link copied to clipboard
common
operator fun component7(): ChosenInlineResult?
component8
Link copied to clipboard
common
operator fun component8(): CallbackQuery?
component9
Link copied to clipboard
common
operator fun component9(): ShippingQuery?
copy
Link copied to clipboard
common
fun copy(updateId: Int, message: Message? = null, editedMessage: Message? = null, channelPost: Message? = null, editedChannelPost: Message? = null, inlineQuery: InlineQuery? = null, chosenInlineResult: ChosenInlineResult? = null, callbackQuery: CallbackQuery? = null, shippingQuery: ShippingQuery? = null, preCheckoutQuery: PreCheckoutQuery? = null, poll: Poll? = null, pollAnswer: PollAnswer? = null): Update
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

callbackQuery
Link copied to clipboard
common
val callbackQuery: CallbackQuery? = null
Optional.
channelPost
Link copied to clipboard
common
val channelPost: Message? = null
Optional.
chosenInlineResult
Link copied to clipboard
common
val chosenInlineResult: ChosenInlineResult? = null
Optional.
editedChannelPost
Link copied to clipboard
common
val editedChannelPost: Message? = null
Optional.
editedMessage
Link copied to clipboard
common
val editedMessage: Message? = null
Optional.
inlineQuery
Link copied to clipboard
common
val inlineQuery: InlineQuery? = null
Optional.
message
Link copied to clipboard
common
val message: Message? = null
Optional.
poll
Link copied to clipboard
common
val poll: Poll? = null
Optional.
pollAnswer
Link copied to clipboard
common
val pollAnswer: PollAnswer? = null
Optional.
preCheckoutQuery
Link copied to clipboard
common
val preCheckoutQuery: PreCheckoutQuery? = null
Optional.
shippingQuery
Link copied to clipboard
common
val shippingQuery: ShippingQuery? = null
Optional.
updateId
Link copied to clipboard
common
val updateId: Int
The update's unique identifier.