MCPcopy Index your code
hub / github.com/python-telegram-bot/python-telegram-bot / Update

Class Update

src/telegram/_update.py:47–862  ·  view source on GitHub ↗

This object represents an incoming update. Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their :attr:`update_id` is equal. Note: At most one of the optional parameters can be present in any given update. .. se

Source from the content-addressed store, hash-verified

45
46
47class Update(TelegramObject):
48 """This object represents an incoming update.
49
50 Objects of this class are comparable in terms of equality. Two objects of this class are
51 considered equal, if their :attr:`update_id` is equal.
52
53 Note:
54 At most one of the optional parameters can be present in any given update.
55
56 .. seealso:: :wiki:`Your First Bot <Extensions---Your-first-Bot>`
57
58 Args:
59 update_id (:obj:`int`): The update&#x27;s unique identifier. Update identifiers start from a
60 certain positive number and increase sequentially. This ID becomes especially handy if
61 you&#x27;re using Webhooks, since it allows you to ignore repeated updates or to restore the
62 correct update sequence, should they get out of order. If there are no new updates for
63 at least a week, then identifier of the next update will be chosen randomly instead of
64 sequentially.
65 message (:class:`telegram.Message`, optional): New incoming message of any kind - text,
66 photo, sticker, etc.
67 edited_message (:class:`telegram.Message`, optional): New version of a message that is
68 known to the bot and was edited. This update may at times be triggered by changes to
69 message fields that are either unavailable or not actively used by your bot.
70 channel_post (:class:`telegram.Message`, optional): New incoming channel post of any kind
71 - text, photo, sticker, etc.
72 edited_channel_post (:class:`telegram.Message`, optional): New version of a channel post
73 that is known to the bot and was edited. This update may at times be triggered by
74 changes to message fields that are either unavailable or not actively used by your bot.
75 inline_query (:class:`telegram.InlineQuery`, optional): New incoming inline query.
76 chosen_inline_result (:class:`telegram.ChosenInlineResult`, optional): The result of an
77 inline query that was chosen by a user and sent to their chat partner.
78 callback_query (:class:`telegram.CallbackQuery`, optional): New incoming callback query.
79 shipping_query (:class:`telegram.ShippingQuery`, optional): New incoming shipping query.
80 Only for invoices with flexible price.
81 pre_checkout_query (:class:`telegram.PreCheckoutQuery`, optional): New incoming
82 pre-checkout query. Contains full information about checkout.
83 poll (:class:`telegram.Poll`, optional): New poll state. Bots receive only updates about
84 manually stopped polls and polls, which are sent by the bot.
85 poll_answer (:class:`telegram.PollAnswer`, optional): A user changed their answer
86 in a non-anonymous poll. Bots receive new votes only in polls that were sent
87 by the bot itself.
88 my_chat_member (:class:`telegram.ChatMemberUpdated`, optional): The bot&#x27;s chat member
89 status was updated in a chat. For private chats, this update is received only when the
90 bot is blocked or unblocked by the user.
91
92 .. versionadded:: 13.4
93 chat_member (:class:`telegram.ChatMemberUpdated`, optional): A chat member&#x27;s status was
94 updated in a chat. The bot must be an administrator in the chat and must explicitly
95 specify :attr:`CHAT_MEMBER` in the list of
96 :paramref:`telegram.ext.Application.run_polling.allowed_updates` to receive these
97 updates (see :meth:`telegram.Bot.get_updates`, :meth:`telegram.Bot.set_webhook`,
98 :meth:`telegram.ext.Application.run_polling` and
99 :meth:`telegram.ext.Application.run_webhook`).
100
101 .. versionadded:: 13.4
102 chat_join_request (:class:`telegram.ChatJoinRequest`, optional): A request to join the
103 chat has been sent. The bot must have the
104 :attr:`telegram.ChatPermissions.can_invite_users` administrator right in the chat to

Callers 15

test_equalityMethod · 0.90
updateFunction · 0.90
test_slot_behaviourMethod · 0.90
test_equalityMethod · 0.90
test_equalityMethod · 0.90
postMethod · 0.90
false_updateFunction · 0.90
test_equalityMethod · 0.90
make_message_updateFunction · 0.90

Calls

no outgoing calls

Tested by 15

test_equalityMethod · 0.72
updateFunction · 0.72
test_slot_behaviourMethod · 0.72
test_equalityMethod · 0.72
test_equalityMethod · 0.72
postMethod · 0.72
false_updateFunction · 0.72
test_equalityMethod · 0.72
false_updateFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…