diff --git a/pyrogram/client/types/update.py b/pyrogram/client/types/update.py index bfa61255..07397d52 100644 --- a/pyrogram/client/types/update.py +++ b/pyrogram/client/types/update.py @@ -20,15 +20,13 @@ from pyrogram.api.core import Object class Update(Object): - """This object represents an incoming update.At most one of the optional parameters can be present in any given update. + """This object represents an incoming update. + At most one of the optional parameters can be present in any given update. Attributes: ID: ``0xb0700000`` Args: - update_id (``int`` ``32-bit``): - 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 (:obj:`Message `, optional): New incoming message of any kind — text, photo, sticker, etc. @@ -45,7 +43,9 @@ class Update(Object): New incoming inline query. chosen_inline_result (:obj:`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. + 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. callback_query (:obj:`CallbackQuery `, optional): New incoming callback query. @@ -59,14 +59,24 @@ class Update(Object): """ ID = 0xb0700000 - def __init__(self, update_id, message=None, edited_message=None, channel_post=None, edited_channel_post=None, inline_query=None, chosen_inline_result=None, callback_query=None, shipping_query=None, pre_checkout_query=None): - self.update_id = update_id # int - self.message = message # flags.0?Message - self.edited_message = edited_message # flags.1?Message - self.channel_post = channel_post # flags.2?Message - self.edited_channel_post = edited_channel_post # flags.3?Message - self.inline_query = inline_query # flags.4?InlineQuery - self.chosen_inline_result = chosen_inline_result # flags.5?ChosenInlineResult - self.callback_query = callback_query # flags.6?CallbackQuery - self.shipping_query = shipping_query # flags.7?ShippingQuery - self.pre_checkout_query = pre_checkout_query # flags.8?PreCheckoutQuery + def __init__( + self, + message=None, + edited_message=None, + channel_post=None, + edited_channel_post=None, + inline_query=None, + chosen_inline_result=None, + callback_query=None, + shipping_query=None, + pre_checkout_query=None + ): + self.message = message + self.edited_message = edited_message + self.channel_post = channel_post + self.edited_channel_post = edited_channel_post + self.inline_query = inline_query + self.chosen_inline_result = chosen_inline_result + self.callback_query = callback_query + self.shipping_query = shipping_query + self.pre_checkout_query = pre_checkout_query