telegram.update module

This module contains an object that represents a Telegram Update.

class telegram.update.Update(update_id, message=None, edited_message=None, inline_query=None, chosen_inline_result=None, callback_query=None, channel_post=None, edited_channel_post=None, **kwargs)

Bases: telegram.base.TelegramObject

This object represents a Telegram Update.

update_id

int – The update’s unique identifier.

message

telegram.Message – New incoming message of any kind - text, photo, sticker, etc.

edited_message

telegram.Message – New version of a message that is known to the bot and was edited

inline_query

telegram.InlineQuery – New incoming inline query.

chosen_inline_result

telegram.ChosenInlineResult – The result of an inline query that was chosen by a user and sent to their chat partner.

callback_query

telegram.CallbackQuery – New incoming callback query.

channel_post

Optional[telegram.Message] – New incoming channel post of any kind - text, photo, sticker, etc.

edited_channel_post

Optional[telegram.Message] – New version of a channel post that is known to the bot and was edited.

Parameters:
static de_json(data, bot)
Parameters:
Returns:

Return type:

telegram.Update

effective_chat

A property that contains the Chat that this update was sent in, no matter what kind of update this is. Will be None for inline queries and chosen inline results.

effective_message

A property that contains the Message included in this update, no matter what kind of update this is. Will be None for inline queries, chosen inline results and callback queries from inline messages.

effective_user

A property that contains the User that sent this update, no matter what kind of update this is. Will be None for channel posts.