Skip to content

GramIO API Reference / @gramio/contexts/dist / Update

Class: Update ​

Defined in: contexts/index.d.ts:5127

This object represents an incoming update.

At most one of the optional parameters can be present in any given update.

Constructors ​

Constructor ​

new Update(payload): Update

Defined in: contexts/index.d.ts:5129

Parameters ​

ParameterType
payloadTelegramUpdate

Returns ​

Update

Properties ​

PropertyTypeDefined in
payloadTelegramUpdatecontexts/index.d.ts:5128

Accessors ​

[toStringTag] ​

Get Signature ​

get [toStringTag](): string

Defined in: contexts/index.d.ts:5131

MDN

Returns ​

string


callbackQuery ​

Get Signature ​

get callbackQuery(): CallbackQuery

Defined in: contexts/index.d.ts:5167

New incoming callback query

Returns ​

CallbackQuery


channelPost ​

Get Signature ​

get channelPost(): Message

Defined in: contexts/index.d.ts:5149

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

Returns ​

Message


chatBoost ​

Get Signature ​

get chatBoost(): ChatBoostUpdated

Defined in: contexts/index.d.ts:5195

A chat boost was added or changed. The bot must be an administrator in the chat to receive these updates.

Returns ​

ChatBoostUpdated


chatJoinRequest ​

Get Signature ​

get chatJoinRequest(): ChatJoinRequest

Defined in: contexts/index.d.ts:5193

A request to join the chat has been sent. The bot must have the can_invite_users administrator right in the chat to receive these updates.

Returns ​

ChatJoinRequest


chatMember ​

Get Signature ​

get chatMember(): ChatMemberUpdated

Defined in: contexts/index.d.ts:5191

A chat member's status was updated in a chat.

The bot must be an administrator in the chat and must explicitly specify chat_member in the list of allowed_updates to receive these updates.

Returns ​

ChatMemberUpdated


chosenInlineResult ​

Get Signature ​

get chosenInlineResult(): ChosenInlineResult

Defined in: contexts/index.d.ts:5165

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.

Returns ​

ChosenInlineResult


editedChannelPost ​

Get Signature ​

get editedChannelPost(): Message

Defined in: contexts/index.d.ts:5151

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

Returns ​

Message


editedMessage ​

Get Signature ​

get editedMessage(): Message

Defined in: contexts/index.d.ts:5147

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

Returns ​

Message


id ​

Get Signature ​

get id(): number

Defined in: contexts/index.d.ts:5141

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.

Returns ​

number


inlineQuery ​

Get Signature ​

get inlineQuery(): InlineQuery

Defined in: contexts/index.d.ts:5159

New incoming inline query

Returns ​

InlineQuery


message ​

Get Signature ​

get message(): Message

Defined in: contexts/index.d.ts:5145

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

Returns ​

Message


messageReaction ​

Get Signature ​

get messageReaction(): MessageReactionUpdated

Defined in: contexts/index.d.ts:5155

A reaction to a message was changed by a user. The bot must be an administrator in the chat and must explicitly specify message_reaction in the list of allowed_updates to receive these updates. The update isn't received for reactions set by bots.

Returns ​

MessageReactionUpdated


messageReactionCount ​

Get Signature ​

get messageReactionCount(): MessageReactionCountUpdated

Defined in: contexts/index.d.ts:5157

Reactions to a message with anonymous reactions were changed. The bot must be an administrator in the chat and must explicitly specify message_reaction_count in the list of allowed_updates to receive these updates.

Returns ​

MessageReactionCountUpdated


myChatMember ​

Get Signature ​

get myChatMember(): ChatMemberUpdated

Defined in: contexts/index.d.ts:5185

The bot's chat member status was updated in a chat. For private chats, this update is received only when the bot is blocked or unblocked by the user.

Returns ​

ChatMemberUpdated


poll ​

Get Signature ​

get poll(): Poll

Defined in: contexts/index.d.ts:5178

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

Returns ​

Poll


pollAnswer ​

Get Signature ​

get pollAnswer(): PollAnswer

Defined in: contexts/index.d.ts:5183

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

Returns ​

PollAnswer


preCheckoutQuery ​

Get Signature ​

get preCheckoutQuery(): PreCheckoutQuery

Defined in: contexts/index.d.ts:5173

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

Returns ​

PreCheckoutQuery


removedChatBoost ​

Get Signature ​

get removedChatBoost(): ChatBoostRemoved

Defined in: contexts/index.d.ts:5197

A boost was removed from a chat. The bot must be an administrator in the chat to receive these updates.

Returns ​

ChatBoostRemoved


shippingQuery ​

Get Signature ​

get shippingQuery(): ShippingQuery

Defined in: contexts/index.d.ts:5169

New incoming shipping query. Only for invoices with flexible price

Returns ​

ShippingQuery


stoppedMessageGeneration ​

Get Signature ​

get stoppedMessageGeneration(): MessageGenerationStopped

Defined in: contexts/index.d.ts:5153

A user stopped an in-progress message generation.

Returns ​

MessageGenerationStopped