diff --git a/NOTICE b/NOTICE index a7e2b00a..dd0fdf54 100644 --- a/NOTICE +++ b/NOTICE @@ -1,5 +1,5 @@ Pyrogram - Telegram MTProto API Client Library for Python -Copyright (C) 2017-2018 Dan Tès +Copyright (C) 2017-2019 Dan Tès This file is part of Pyrogram. diff --git a/compiler/__init__.py b/compiler/__init__.py index eddf3281..f3769dd4 100644 --- a/compiler/__init__.py +++ b/compiler/__init__.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/compiler/api/__init__.py b/compiler/api/__init__.py index eddf3281..f3769dd4 100644 --- a/compiler/api/__init__.py +++ b/compiler/api/__init__.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/compiler/api/compiler.py b/compiler/api/compiler.py index d31353c6..57e4d22b 100644 --- a/compiler/api/compiler.py +++ b/compiler/api/compiler.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/compiler/docs/__init__.py b/compiler/docs/__init__.py index eddf3281..f3769dd4 100644 --- a/compiler/docs/__init__.py +++ b/compiler/docs/__init__.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/compiler/docs/compiler.py b/compiler/docs/compiler.py index 57f4827f..6ea2240d 100644 --- a/compiler/docs/compiler.py +++ b/compiler/docs/compiler.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/compiler/error/__init__.py b/compiler/error/__init__.py index eddf3281..f3769dd4 100644 --- a/compiler/error/__init__.py +++ b/compiler/error/__init__.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/compiler/error/compiler.py b/compiler/error/compiler.py index aaefde9f..b86222e7 100644 --- a/compiler/error/compiler.py +++ b/compiler/error/compiler.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/docs/source/index.rst b/docs/source/index.rst index 085b38fb..ca9a38a3 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -84,6 +84,7 @@ To get started, press the Next button. resources/UpdateHandling resources/UsingFilters + resources/MoreOnUpdates resources/SmartPlugins resources/AutoAuthorization resources/CustomizeSessions diff --git a/docs/source/resources/MoreOnUpdates.rst b/docs/source/resources/MoreOnUpdates.rst new file mode 100644 index 00000000..44295f35 --- /dev/null +++ b/docs/source/resources/MoreOnUpdates.rst @@ -0,0 +1,148 @@ +More on Updates +=============== + +Here we'll show some advanced usages when working with updates. + +.. note:: + This page makes use of Handlers and Filters to show you how to handle updates. + Learn more at `Update Handling `_ and `Using Filters `_. + +Handler Groups +-------------- + +If you register handlers with overlapping filters, only the first one is executed and any other handler will be ignored. + +In order to process the same update more than once, you can register your handler in a different group. +Groups are identified by a number (number 0 being the default) and are sorted, that is, a lower group number has a +higher priority. + +For example, in: + +.. code-block:: python + + @app.on_message(Filters.text | Filters.sticker) + def text_or_sticker(client, message): + print("Text or Sticker") + + + @app.on_message(Filters.text) + def just_text(client, message): + print("Just Text") + +``just_text`` is never executed because ``text_or_sticker`` already handles texts. To enable it, simply register the +function using a different group: + +.. code-block:: python + + @app.on_message(Filters.text, group=1) + def just_text(client, message): + print("Just Text") + +Or, if you want ``just_text`` to be fired *before* ``text_or_sticker`` (note ``-1``, which is less than ``0``): + +.. code-block:: python + + @app.on_message(Filters.text, group=-1) + def just_text(client, message): + print("Just Text") + +With :meth:`add_handler() ` (without decorators) the same can be achieved with: + +.. code-block:: python + + app.add_handler(MessageHandler(just_text, Filters.text), -1) + +Update propagation +------------------ + +Registering multiple handlers, each in a different group, becomes useful when you want to handle the same update more +than once. Any incoming update will be sequentially processed by all of your registered functions by respecting the +groups priority policy described above. Even in case any handler raises an unhandled exception, Pyrogram will still +continue to propagate the same update to the next groups until all the handlers are done. Example: + +.. code-block:: python + + @app.on_message(Filters.private) + def _(client, message): + print(0) + + + @app.on_message(Filters.private, group=1) + def _(client, message): + print(1 / 0) # Unhandled exception: ZeroDivisionError + + + @app.on_message(Filters.private, group=2) + def _(client, message): + print(2) + +All these handlers will handle the same kind of messages, that are, messages sent or received in private chats. +The output for each incoming update will therefore be: + +.. code-block:: text + + 0 + ZeroDivisionError: division by zero + 2 + +Stop Propagation +^^^^^^^^^^^^^^^^ + +In order to prevent further propagation of an update in the dispatching phase, you can do *one* of the following: + +- Call the update's bound-method ``.stop_propagation()`` (preferred way). +- Manually ``raise StopPropagation`` error (more suitable for raw updates only). + +.. note:: + + Note that ``.stop_propagation()`` is just an elegant and intuitive way to raise a ``StopPropagation`` error; + this means that any code coming *after* calling it won't be executed as your function just raised a custom exception + to signal the dispatcher not to propagate the update anymore. + +Example with ``stop_propagation()``: + +.. code-block:: python + + @app.on_message(Filters.private) + def _(client, message): + print(0) + + + @app.on_message(Filters.private, group=1) + def _(client, message): + print(1) + message.stop_propagation() + + + @app.on_message(Filters.private, group=2) + def _(client, message): + print(2) + +Example with ``raise StopPropagation``: + +.. code-block:: python + + from pyrogram import StopPropagation + + @app.on_message(Filters.private) + def _(client, message): + print(0) + + + @app.on_message(Filters.private, group=1) + def _(client, message): + print(1) + raise StopPropagation + + + @app.on_message(Filters.private, group=2) + def _(client, message): + print(2) + +The handler in group number 2 will never be executed because the propagation was stopped before. The output of both +examples will be: + +.. code-block:: text + + 0 + 1 diff --git a/docs/source/resources/UsingFilters.rst b/docs/source/resources/UsingFilters.rst index d70005a5..3fe87b8a 100644 --- a/docs/source/resources/UsingFilters.rst +++ b/docs/source/resources/UsingFilters.rst @@ -5,7 +5,8 @@ For a finer grained control over what kind of messages will be allowed or not in :class:`Filters `. .. note:: - This section makes use of Handlers to handle updates. Learn more at `Update Handling `_. + This page makes use of Handlers to show you how to handle updates. + Learn more at `Update Handling `_. - This example will show you how to **only** handle messages containing an :obj:`Audio ` object and ignore any other message: @@ -99,45 +100,6 @@ More handlers using different filters can also live together. def from_pyrogramchat(client, message): print("New message in @PyrogramChat") -Handler Groups --------------- - -If you register handlers with overlapping filters, only the first one is executed and any other handler will be ignored. - -In order to process the same message more than once, you can register your handler in a different group. -Groups are identified by a number (number 0 being the default) and are sorted. This means that a lower group number has -a higher priority. - -For example, in: - -.. code-block:: python - - @app.on_message(Filters.text | Filters.sticker) - def text_or_sticker(client, message): - print("Text or Sticker") - - - @app.on_message(Filters.text) - def just_text(client, message): - print("Just Text") - -``just_text`` is never executed because ``text_or_sticker`` already handles texts. To enable it, simply register the -function using a different group: - -.. code-block:: python - - @app.on_message(Filters.text, group=1) - def just_text(client, message): - print("Just Text") - -or, if you want ``just_text`` to be fired *before* ``text_or_sticker`` (note ``-1``, which is less than ``0``): - -.. code-block:: python - - @app.on_message(Filters.text, group=-1) - def just_text(client, message): - print("Just Text") - Custom Filters -------------- diff --git a/docs/source/start/Installation.rst b/docs/source/start/Installation.rst index 3769b9f9..78adf6ae 100644 --- a/docs/source/start/Installation.rst +++ b/docs/source/start/Installation.rst @@ -82,7 +82,7 @@ If no error shows up you are good to go. >>> import pyrogram >>> pyrogram.__version__ - '0.10.2' + '0.10.3' .. _TgCrypto: https://docs.pyrogram.ml/resources/TgCrypto .. _develop: http://github.com/pyrogram/pyrogram diff --git a/pyrogram/__init__.py b/pyrogram/__init__.py index bb155d90..abeb8b43 100644 --- a/pyrogram/__init__.py +++ b/pyrogram/__init__.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # @@ -23,7 +23,7 @@ __copyright__ = "Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/api/core/__init__.py b/pyrogram/api/core/__init__.py index 2bf38b8d..daba6b7c 100644 --- a/pyrogram/api/core/__init__.py +++ b/pyrogram/api/core/__init__.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/api/core/future_salt.py b/pyrogram/api/core/future_salt.py index 99f11678..bce01dc8 100644 --- a/pyrogram/api/core/future_salt.py +++ b/pyrogram/api/core/future_salt.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/api/core/future_salts.py b/pyrogram/api/core/future_salts.py index dc579035..bddfdb47 100644 --- a/pyrogram/api/core/future_salts.py +++ b/pyrogram/api/core/future_salts.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/api/core/gzip_packed.py b/pyrogram/api/core/gzip_packed.py index 93c3b377..8b26be9d 100644 --- a/pyrogram/api/core/gzip_packed.py +++ b/pyrogram/api/core/gzip_packed.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/api/core/message.py b/pyrogram/api/core/message.py index 1a48489a..35459ef8 100644 --- a/pyrogram/api/core/message.py +++ b/pyrogram/api/core/message.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/api/core/msg_container.py b/pyrogram/api/core/msg_container.py index 7728bd37..4373498d 100644 --- a/pyrogram/api/core/msg_container.py +++ b/pyrogram/api/core/msg_container.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/api/core/object.py b/pyrogram/api/core/object.py index a1e20726..1a3cb388 100644 --- a/pyrogram/api/core/object.py +++ b/pyrogram/api/core/object.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/api/core/primitives/__init__.py b/pyrogram/api/core/primitives/__init__.py index 63d7ef97..8885878b 100644 --- a/pyrogram/api/core/primitives/__init__.py +++ b/pyrogram/api/core/primitives/__init__.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/api/core/primitives/bool.py b/pyrogram/api/core/primitives/bool.py index 9641e865..117ee7a4 100644 --- a/pyrogram/api/core/primitives/bool.py +++ b/pyrogram/api/core/primitives/bool.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/api/core/primitives/bytes.py b/pyrogram/api/core/primitives/bytes.py index d161cc9c..8030b598 100644 --- a/pyrogram/api/core/primitives/bytes.py +++ b/pyrogram/api/core/primitives/bytes.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/api/core/primitives/double.py b/pyrogram/api/core/primitives/double.py index 94d7e3b9..3dcaa461 100644 --- a/pyrogram/api/core/primitives/double.py +++ b/pyrogram/api/core/primitives/double.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/api/core/primitives/int.py b/pyrogram/api/core/primitives/int.py index 4b9aded8..7833a610 100644 --- a/pyrogram/api/core/primitives/int.py +++ b/pyrogram/api/core/primitives/int.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/api/core/primitives/null.py b/pyrogram/api/core/primitives/null.py index 7a26b112..d2d3b1c0 100644 --- a/pyrogram/api/core/primitives/null.py +++ b/pyrogram/api/core/primitives/null.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/api/core/primitives/string.py b/pyrogram/api/core/primitives/string.py index 3584d1b9..a271695a 100644 --- a/pyrogram/api/core/primitives/string.py +++ b/pyrogram/api/core/primitives/string.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/api/core/primitives/vector.py b/pyrogram/api/core/primitives/vector.py index e2642e0f..cd24ec35 100644 --- a/pyrogram/api/core/primitives/vector.py +++ b/pyrogram/api/core/primitives/vector.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/api/errors/__init__.py b/pyrogram/api/errors/__init__.py index 0ed04e02..ca65619c 100644 --- a/pyrogram/api/errors/__init__.py +++ b/pyrogram/api/errors/__init__.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/api/errors/error.py b/pyrogram/api/errors/error.py index 397af546..5f92a369 100644 --- a/pyrogram/api/errors/error.py +++ b/pyrogram/api/errors/error.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/__init__.py b/pyrogram/client/__init__.py index 00b9905a..2719d82e 100644 --- a/pyrogram/client/__init__.py +++ b/pyrogram/client/__init__.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index 673fc33c..3dcaaf12 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/dispatcher/__init__.py b/pyrogram/client/dispatcher/__init__.py index c0cb368a..e2e67b70 100644 --- a/pyrogram/client/dispatcher/__init__.py +++ b/pyrogram/client/dispatcher/__init__.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/dispatcher/dispatcher.py b/pyrogram/client/dispatcher/dispatcher.py index 5b30daf9..47999bc6 100644 --- a/pyrogram/client/dispatcher/dispatcher.py +++ b/pyrogram/client/dispatcher/dispatcher.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # @@ -134,24 +134,29 @@ class Dispatcher: parsed_update, handler_type = parser(update, users, chats) for group in self.groups.values(): - for handler in group: - args = None + try: + for handler in group: + args = None - if isinstance(handler, RawUpdateHandler): - args = (update, users, chats) - elif isinstance(handler, handler_type): - if handler.check(parsed_update): - args = (parsed_update,) + if isinstance(handler, RawUpdateHandler): + args = (update, users, chats) + elif isinstance(handler, handler_type): + if handler.check(parsed_update): + args = (parsed_update,) - if args is None: - continue + if args is None: + continue + + try: + handler.callback(self.client, *args) + except StopIteration: + raise + except Exception as e: + log.error(e, exc_info=True) - try: - handler.callback(self.client, *args) - except Exception as e: - log.error(e, exc_info=True) - finally: break + except StopIteration: + break except Exception as e: log.error(e, exc_info=True) diff --git a/pyrogram/client/ext/__init__.py b/pyrogram/client/ext/__init__.py index 38eaf089..ce80958a 100644 --- a/pyrogram/client/ext/__init__.py +++ b/pyrogram/client/ext/__init__.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/ext/base_client.py b/pyrogram/client/ext/base_client.py index 32046115..7aee5302 100644 --- a/pyrogram/client/ext/base_client.py +++ b/pyrogram/client/ext/base_client.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # @@ -103,6 +103,9 @@ class BaseClient: def resolve_peer(self, peer_id: int or str): pass + def fetch_peers(self, entities): + pass + def add_handler(self, handler, group: int = 0) -> tuple: pass diff --git a/pyrogram/client/ext/chat_action.py b/pyrogram/client/ext/chat_action.py index 96c5164e..c0ee0585 100644 --- a/pyrogram/client/ext/chat_action.py +++ b/pyrogram/client/ext/chat_action.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/ext/emoji.py b/pyrogram/client/ext/emoji.py index b2dd99fd..20d154f4 100644 --- a/pyrogram/client/ext/emoji.py +++ b/pyrogram/client/ext/emoji.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/ext/parse_mode.py b/pyrogram/client/ext/parse_mode.py index 817bccb0..46ed97e3 100644 --- a/pyrogram/client/ext/parse_mode.py +++ b/pyrogram/client/ext/parse_mode.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/ext/syncer.py b/pyrogram/client/ext/syncer.py index 125c5ce0..e169d2a3 100644 --- a/pyrogram/client/ext/syncer.py +++ b/pyrogram/client/ext/syncer.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/ext/utils.py b/pyrogram/client/ext/utils.py index 3e67e3cd..087773f4 100644 --- a/pyrogram/client/ext/utils.py +++ b/pyrogram/client/ext/utils.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/filters/__init__.py b/pyrogram/client/filters/__init__.py index 88ae14e3..318d8645 100644 --- a/pyrogram/client/filters/__init__.py +++ b/pyrogram/client/filters/__init__.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/filters/filter.py b/pyrogram/client/filters/filter.py index feec51df..f8bf5e3e 100644 --- a/pyrogram/client/filters/filter.py +++ b/pyrogram/client/filters/filter.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/filters/filters.py b/pyrogram/client/filters/filters.py index 1347f993..c0ebfdcf 100644 --- a/pyrogram/client/filters/filters.py +++ b/pyrogram/client/filters/filters.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/handlers/__init__.py b/pyrogram/client/handlers/__init__.py index ff1ead7a..499ed007 100644 --- a/pyrogram/client/handlers/__init__.py +++ b/pyrogram/client/handlers/__init__.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/handlers/callback_query_handler.py b/pyrogram/client/handlers/callback_query_handler.py index 5d09f7d9..e991c019 100644 --- a/pyrogram/client/handlers/callback_query_handler.py +++ b/pyrogram/client/handlers/callback_query_handler.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/handlers/deleted_messages_handler.py b/pyrogram/client/handlers/deleted_messages_handler.py index 8f5ef448..c084f353 100644 --- a/pyrogram/client/handlers/deleted_messages_handler.py +++ b/pyrogram/client/handlers/deleted_messages_handler.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/handlers/disconnect_handler.py b/pyrogram/client/handlers/disconnect_handler.py index a8b800a8..1e88a7ee 100644 --- a/pyrogram/client/handlers/disconnect_handler.py +++ b/pyrogram/client/handlers/disconnect_handler.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/handlers/handler.py b/pyrogram/client/handlers/handler.py index 0e46a205..9fd0e206 100644 --- a/pyrogram/client/handlers/handler.py +++ b/pyrogram/client/handlers/handler.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/handlers/message_handler.py b/pyrogram/client/handlers/message_handler.py index e4c3d13f..8a52a0b5 100644 --- a/pyrogram/client/handlers/message_handler.py +++ b/pyrogram/client/handlers/message_handler.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/handlers/raw_update_handler.py b/pyrogram/client/handlers/raw_update_handler.py index 5a8913b6..3a5dea50 100644 --- a/pyrogram/client/handlers/raw_update_handler.py +++ b/pyrogram/client/handlers/raw_update_handler.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/handlers/user_status_handler.py b/pyrogram/client/handlers/user_status_handler.py index 2442d7eb..643a064d 100644 --- a/pyrogram/client/handlers/user_status_handler.py +++ b/pyrogram/client/handlers/user_status_handler.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/__init__.py b/pyrogram/client/methods/__init__.py index ea249e3f..625ec09a 100644 --- a/pyrogram/client/methods/__init__.py +++ b/pyrogram/client/methods/__init__.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/bots/__init__.py b/pyrogram/client/methods/bots/__init__.py index 2d89c2fb..b0430efe 100644 --- a/pyrogram/client/methods/bots/__init__.py +++ b/pyrogram/client/methods/bots/__init__.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/bots/answer_callback_query.py b/pyrogram/client/methods/bots/answer_callback_query.py index 00e437b1..5e8468e5 100644 --- a/pyrogram/client/methods/bots/answer_callback_query.py +++ b/pyrogram/client/methods/bots/answer_callback_query.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/bots/get_inline_bot_results.py b/pyrogram/client/methods/bots/get_inline_bot_results.py index a5b9ae9f..e76a0d1d 100644 --- a/pyrogram/client/methods/bots/get_inline_bot_results.py +++ b/pyrogram/client/methods/bots/get_inline_bot_results.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/bots/request_callback_answer.py b/pyrogram/client/methods/bots/request_callback_answer.py index 0cb6a1dd..74e2d26d 100644 --- a/pyrogram/client/methods/bots/request_callback_answer.py +++ b/pyrogram/client/methods/bots/request_callback_answer.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/bots/send_inline_bot_result.py b/pyrogram/client/methods/bots/send_inline_bot_result.py index 8c6a38b5..66caab16 100644 --- a/pyrogram/client/methods/bots/send_inline_bot_result.py +++ b/pyrogram/client/methods/bots/send_inline_bot_result.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/chats/__init__.py b/pyrogram/client/methods/chats/__init__.py index 3d928e87..745678cc 100644 --- a/pyrogram/client/methods/chats/__init__.py +++ b/pyrogram/client/methods/chats/__init__.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/chats/delete_chat_photo.py b/pyrogram/client/methods/chats/delete_chat_photo.py index a33cae05..0164ff43 100644 --- a/pyrogram/client/methods/chats/delete_chat_photo.py +++ b/pyrogram/client/methods/chats/delete_chat_photo.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/chats/export_chat_invite_link.py b/pyrogram/client/methods/chats/export_chat_invite_link.py index f458e91e..9ff8c9c0 100644 --- a/pyrogram/client/methods/chats/export_chat_invite_link.py +++ b/pyrogram/client/methods/chats/export_chat_invite_link.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/chats/get_chat.py b/pyrogram/client/methods/chats/get_chat.py index 03bf2a08..d30fd9bb 100644 --- a/pyrogram/client/methods/chats/get_chat.py +++ b/pyrogram/client/methods/chats/get_chat.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # @@ -56,6 +56,8 @@ class GetChat(BaseClient): if isinstance(r, types.ChatInvite): raise ValueError("You haven't joined \"t.me/joinchat/{}\" yet".format(h)) + self.fetch_peers([r.chat]) + if isinstance(r.chat, types.Chat): chat_id = -r.chat.id diff --git a/pyrogram/client/methods/chats/get_chat_member.py b/pyrogram/client/methods/chats/get_chat_member.py index 9f13eac2..4b67dd5e 100644 --- a/pyrogram/client/methods/chats/get_chat_member.py +++ b/pyrogram/client/methods/chats/get_chat_member.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/chats/get_chat_members.py b/pyrogram/client/methods/chats/get_chat_members.py index 8173423b..1d99ec4b 100644 --- a/pyrogram/client/methods/chats/get_chat_members.py +++ b/pyrogram/client/methods/chats/get_chat_members.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/chats/get_chat_members_count.py b/pyrogram/client/methods/chats/get_chat_members_count.py index 37eb69cb..9360b64f 100644 --- a/pyrogram/client/methods/chats/get_chat_members_count.py +++ b/pyrogram/client/methods/chats/get_chat_members_count.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/chats/get_dialogs.py b/pyrogram/client/methods/chats/get_dialogs.py index 757cf5bc..f80518b0 100644 --- a/pyrogram/client/methods/chats/get_dialogs.py +++ b/pyrogram/client/methods/chats/get_dialogs.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/chats/join_chat.py b/pyrogram/client/methods/chats/join_chat.py index 2c70a52f..f5b632fc 100644 --- a/pyrogram/client/methods/chats/join_chat.py +++ b/pyrogram/client/methods/chats/join_chat.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/chats/kick_chat_member.py b/pyrogram/client/methods/chats/kick_chat_member.py index 4ea4d6bb..b02e02cc 100644 --- a/pyrogram/client/methods/chats/kick_chat_member.py +++ b/pyrogram/client/methods/chats/kick_chat_member.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/chats/leave_chat.py b/pyrogram/client/methods/chats/leave_chat.py index e0ac3bb6..5b765ac0 100644 --- a/pyrogram/client/methods/chats/leave_chat.py +++ b/pyrogram/client/methods/chats/leave_chat.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/chats/pin_chat_message.py b/pyrogram/client/methods/chats/pin_chat_message.py index 66d5497d..bb70f9e8 100644 --- a/pyrogram/client/methods/chats/pin_chat_message.py +++ b/pyrogram/client/methods/chats/pin_chat_message.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/chats/promote_chat_member.py b/pyrogram/client/methods/chats/promote_chat_member.py index 18453b58..9f2260f0 100644 --- a/pyrogram/client/methods/chats/promote_chat_member.py +++ b/pyrogram/client/methods/chats/promote_chat_member.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/chats/restrict_chat_member.py b/pyrogram/client/methods/chats/restrict_chat_member.py index f9670250..dbe0054b 100644 --- a/pyrogram/client/methods/chats/restrict_chat_member.py +++ b/pyrogram/client/methods/chats/restrict_chat_member.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/chats/set_chat_description.py b/pyrogram/client/methods/chats/set_chat_description.py index 7cf91da5..e6c5bba1 100644 --- a/pyrogram/client/methods/chats/set_chat_description.py +++ b/pyrogram/client/methods/chats/set_chat_description.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/chats/set_chat_photo.py b/pyrogram/client/methods/chats/set_chat_photo.py index 7d276648..cc5c776a 100644 --- a/pyrogram/client/methods/chats/set_chat_photo.py +++ b/pyrogram/client/methods/chats/set_chat_photo.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/chats/set_chat_title.py b/pyrogram/client/methods/chats/set_chat_title.py index af2b6e77..fff330ee 100644 --- a/pyrogram/client/methods/chats/set_chat_title.py +++ b/pyrogram/client/methods/chats/set_chat_title.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/chats/unban_chat_member.py b/pyrogram/client/methods/chats/unban_chat_member.py index 3513f38d..da706a1f 100644 --- a/pyrogram/client/methods/chats/unban_chat_member.py +++ b/pyrogram/client/methods/chats/unban_chat_member.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/chats/unpin_chat_message.py b/pyrogram/client/methods/chats/unpin_chat_message.py index 9aa56a7c..4355010d 100644 --- a/pyrogram/client/methods/chats/unpin_chat_message.py +++ b/pyrogram/client/methods/chats/unpin_chat_message.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/contacts/__init__.py b/pyrogram/client/methods/contacts/__init__.py index e0fe52fb..ab9ae6ef 100644 --- a/pyrogram/client/methods/contacts/__init__.py +++ b/pyrogram/client/methods/contacts/__init__.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/contacts/add_contacts.py b/pyrogram/client/methods/contacts/add_contacts.py index a5f06050..48575a78 100644 --- a/pyrogram/client/methods/contacts/add_contacts.py +++ b/pyrogram/client/methods/contacts/add_contacts.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/contacts/delete_contacts.py b/pyrogram/client/methods/contacts/delete_contacts.py index 2c18c6d8..dba2581d 100644 --- a/pyrogram/client/methods/contacts/delete_contacts.py +++ b/pyrogram/client/methods/contacts/delete_contacts.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/contacts/get_contacts.py b/pyrogram/client/methods/contacts/get_contacts.py index c8f903ce..7e90476c 100644 --- a/pyrogram/client/methods/contacts/get_contacts.py +++ b/pyrogram/client/methods/contacts/get_contacts.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/decorators/__init__.py b/pyrogram/client/methods/decorators/__init__.py index 6cf9940a..07f84b54 100644 --- a/pyrogram/client/methods/decorators/__init__.py +++ b/pyrogram/client/methods/decorators/__init__.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/decorators/on_callback_query.py b/pyrogram/client/methods/decorators/on_callback_query.py index 8c152706..bf0a823a 100644 --- a/pyrogram/client/methods/decorators/on_callback_query.py +++ b/pyrogram/client/methods/decorators/on_callback_query.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/decorators/on_deleted_messages.py b/pyrogram/client/methods/decorators/on_deleted_messages.py index 84abc92e..1b1a602b 100644 --- a/pyrogram/client/methods/decorators/on_deleted_messages.py +++ b/pyrogram/client/methods/decorators/on_deleted_messages.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/decorators/on_disconnect.py b/pyrogram/client/methods/decorators/on_disconnect.py index 56796bf5..4657af3b 100644 --- a/pyrogram/client/methods/decorators/on_disconnect.py +++ b/pyrogram/client/methods/decorators/on_disconnect.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/decorators/on_message.py b/pyrogram/client/methods/decorators/on_message.py index a252c6ba..c2f35a19 100644 --- a/pyrogram/client/methods/decorators/on_message.py +++ b/pyrogram/client/methods/decorators/on_message.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/decorators/on_raw_update.py b/pyrogram/client/methods/decorators/on_raw_update.py index ce2584d5..2deedb00 100644 --- a/pyrogram/client/methods/decorators/on_raw_update.py +++ b/pyrogram/client/methods/decorators/on_raw_update.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/decorators/on_user_status.py b/pyrogram/client/methods/decorators/on_user_status.py index c552e706..6198c9cd 100644 --- a/pyrogram/client/methods/decorators/on_user_status.py +++ b/pyrogram/client/methods/decorators/on_user_status.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/messages/__init__.py b/pyrogram/client/methods/messages/__init__.py index cfb36fd0..237b6493 100644 --- a/pyrogram/client/methods/messages/__init__.py +++ b/pyrogram/client/methods/messages/__init__.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/messages/delete_messages.py b/pyrogram/client/methods/messages/delete_messages.py index 030a1663..06acbb1f 100644 --- a/pyrogram/client/methods/messages/delete_messages.py +++ b/pyrogram/client/methods/messages/delete_messages.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/messages/download_media.py b/pyrogram/client/methods/messages/download_media.py index 1cddfe98..cfdcfce7 100644 --- a/pyrogram/client/methods/messages/download_media.py +++ b/pyrogram/client/methods/messages/download_media.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/messages/edit_message_caption.py b/pyrogram/client/methods/messages/edit_message_caption.py index 7709a3d8..fe704e41 100644 --- a/pyrogram/client/methods/messages/edit_message_caption.py +++ b/pyrogram/client/methods/messages/edit_message_caption.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/messages/edit_message_media.py b/pyrogram/client/methods/messages/edit_message_media.py index 02b26ea6..bc423a01 100644 --- a/pyrogram/client/methods/messages/edit_message_media.py +++ b/pyrogram/client/methods/messages/edit_message_media.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/messages/edit_message_reply_markup.py b/pyrogram/client/methods/messages/edit_message_reply_markup.py index f46dd2f4..f8b5c0a5 100644 --- a/pyrogram/client/methods/messages/edit_message_reply_markup.py +++ b/pyrogram/client/methods/messages/edit_message_reply_markup.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/messages/edit_message_text.py b/pyrogram/client/methods/messages/edit_message_text.py index 173caa93..1d2a065b 100644 --- a/pyrogram/client/methods/messages/edit_message_text.py +++ b/pyrogram/client/methods/messages/edit_message_text.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/messages/forward_messages.py b/pyrogram/client/methods/messages/forward_messages.py index f8379c0c..72e43e08 100644 --- a/pyrogram/client/methods/messages/forward_messages.py +++ b/pyrogram/client/methods/messages/forward_messages.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/messages/get_history.py b/pyrogram/client/methods/messages/get_history.py index ce12e9b0..c2f4226b 100644 --- a/pyrogram/client/methods/messages/get_history.py +++ b/pyrogram/client/methods/messages/get_history.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # @@ -45,7 +45,7 @@ class GetHistory(BaseClient): Limits the number of messages to be retrieved. By default, the first 100 messages are returned. - offset (``int``, *optional*) + offset (``int``, *optional*): Sequential number of the first message to be returned. Defaults to 0 (most recent message). Negative values are also accepted and become useful in case you set offset_id or offset_date. diff --git a/pyrogram/client/methods/messages/get_messages.py b/pyrogram/client/methods/messages/get_messages.py index d0c064f9..f5497629 100644 --- a/pyrogram/client/methods/messages/get_messages.py +++ b/pyrogram/client/methods/messages/get_messages.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/messages/retract_vote.py b/pyrogram/client/methods/messages/retract_vote.py index e0852355..7893f768 100644 --- a/pyrogram/client/methods/messages/retract_vote.py +++ b/pyrogram/client/methods/messages/retract_vote.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/messages/send_animation.py b/pyrogram/client/methods/messages/send_animation.py index 2ebfd87f..08b69c17 100644 --- a/pyrogram/client/methods/messages/send_animation.py +++ b/pyrogram/client/methods/messages/send_animation.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/messages/send_audio.py b/pyrogram/client/methods/messages/send_audio.py index 47db3cbe..da08f5f7 100644 --- a/pyrogram/client/methods/messages/send_audio.py +++ b/pyrogram/client/methods/messages/send_audio.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/messages/send_chat_action.py b/pyrogram/client/methods/messages/send_chat_action.py index 61e9994f..479e7abb 100644 --- a/pyrogram/client/methods/messages/send_chat_action.py +++ b/pyrogram/client/methods/messages/send_chat_action.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/messages/send_contact.py b/pyrogram/client/methods/messages/send_contact.py index 5312f0ac..96b23a9b 100644 --- a/pyrogram/client/methods/messages/send_contact.py +++ b/pyrogram/client/methods/messages/send_contact.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/messages/send_document.py b/pyrogram/client/methods/messages/send_document.py index f42c83d7..393b094c 100644 --- a/pyrogram/client/methods/messages/send_document.py +++ b/pyrogram/client/methods/messages/send_document.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/messages/send_location.py b/pyrogram/client/methods/messages/send_location.py index dbd04e7a..b899a938 100644 --- a/pyrogram/client/methods/messages/send_location.py +++ b/pyrogram/client/methods/messages/send_location.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/messages/send_media_group.py b/pyrogram/client/methods/messages/send_media_group.py index 0b18cac3..e1731e0b 100644 --- a/pyrogram/client/methods/messages/send_media_group.py +++ b/pyrogram/client/methods/messages/send_media_group.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/messages/send_message.py b/pyrogram/client/methods/messages/send_message.py index 982ce1c7..c25ec570 100644 --- a/pyrogram/client/methods/messages/send_message.py +++ b/pyrogram/client/methods/messages/send_message.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/messages/send_photo.py b/pyrogram/client/methods/messages/send_photo.py index 26f6948a..a5f858b2 100644 --- a/pyrogram/client/methods/messages/send_photo.py +++ b/pyrogram/client/methods/messages/send_photo.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/messages/send_poll.py b/pyrogram/client/methods/messages/send_poll.py index 33f44767..8e938a1a 100644 --- a/pyrogram/client/methods/messages/send_poll.py +++ b/pyrogram/client/methods/messages/send_poll.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/messages/send_sticker.py b/pyrogram/client/methods/messages/send_sticker.py index 936d2e54..aea8b057 100644 --- a/pyrogram/client/methods/messages/send_sticker.py +++ b/pyrogram/client/methods/messages/send_sticker.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/messages/send_venue.py b/pyrogram/client/methods/messages/send_venue.py index fca07898..163be38e 100644 --- a/pyrogram/client/methods/messages/send_venue.py +++ b/pyrogram/client/methods/messages/send_venue.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/messages/send_video.py b/pyrogram/client/methods/messages/send_video.py index 15b98732..42f0d314 100644 --- a/pyrogram/client/methods/messages/send_video.py +++ b/pyrogram/client/methods/messages/send_video.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/messages/send_video_note.py b/pyrogram/client/methods/messages/send_video_note.py index 32202a0b..5333311c 100644 --- a/pyrogram/client/methods/messages/send_video_note.py +++ b/pyrogram/client/methods/messages/send_video_note.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/messages/send_voice.py b/pyrogram/client/methods/messages/send_voice.py index 014e8e9f..74a30ccf 100644 --- a/pyrogram/client/methods/messages/send_voice.py +++ b/pyrogram/client/methods/messages/send_voice.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/messages/vote_poll.py b/pyrogram/client/methods/messages/vote_poll.py index 3404a7bd..9e400e62 100644 --- a/pyrogram/client/methods/messages/vote_poll.py +++ b/pyrogram/client/methods/messages/vote_poll.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/password/__init__.py b/pyrogram/client/methods/password/__init__.py index 07d8dd7d..8a29b0a4 100644 --- a/pyrogram/client/methods/password/__init__.py +++ b/pyrogram/client/methods/password/__init__.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/password/change_cloud_password.py b/pyrogram/client/methods/password/change_cloud_password.py index 73775056..3504dab1 100644 --- a/pyrogram/client/methods/password/change_cloud_password.py +++ b/pyrogram/client/methods/password/change_cloud_password.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/password/enable_cloud_password.py b/pyrogram/client/methods/password/enable_cloud_password.py index c8fd4dcb..980f50fd 100644 --- a/pyrogram/client/methods/password/enable_cloud_password.py +++ b/pyrogram/client/methods/password/enable_cloud_password.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/password/remove_cloud_password.py b/pyrogram/client/methods/password/remove_cloud_password.py index a86ed5f8..6817ab12 100644 --- a/pyrogram/client/methods/password/remove_cloud_password.py +++ b/pyrogram/client/methods/password/remove_cloud_password.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/password/utils.py b/pyrogram/client/methods/password/utils.py index 01c3fe49..24c4dd28 100644 --- a/pyrogram/client/methods/password/utils.py +++ b/pyrogram/client/methods/password/utils.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/users/__init__.py b/pyrogram/client/methods/users/__init__.py index 11f51d19..db5e5869 100644 --- a/pyrogram/client/methods/users/__init__.py +++ b/pyrogram/client/methods/users/__init__.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/users/delete_user_profile_photos.py b/pyrogram/client/methods/users/delete_user_profile_photos.py index 91c59247..025a5e95 100644 --- a/pyrogram/client/methods/users/delete_user_profile_photos.py +++ b/pyrogram/client/methods/users/delete_user_profile_photos.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/users/get_me.py b/pyrogram/client/methods/users/get_me.py index 211e2ee9..beea1243 100644 --- a/pyrogram/client/methods/users/get_me.py +++ b/pyrogram/client/methods/users/get_me.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/users/get_user_profile_photos.py b/pyrogram/client/methods/users/get_user_profile_photos.py index 2108f2d6..2129dba3 100644 --- a/pyrogram/client/methods/users/get_user_profile_photos.py +++ b/pyrogram/client/methods/users/get_user_profile_photos.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/users/get_users.py b/pyrogram/client/methods/users/get_users.py index d7b80579..6c340ffa 100644 --- a/pyrogram/client/methods/users/get_users.py +++ b/pyrogram/client/methods/users/get_users.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/methods/users/set_user_profile_photo.py b/pyrogram/client/methods/users/set_user_profile_photo.py index f2a2c302..0863c695 100644 --- a/pyrogram/client/methods/users/set_user_profile_photo.py +++ b/pyrogram/client/methods/users/set_user_profile_photo.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/style/__init__.py b/pyrogram/client/style/__init__.py index e60b4da1..768cee7b 100644 --- a/pyrogram/client/style/__init__.py +++ b/pyrogram/client/style/__init__.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/style/html.py b/pyrogram/client/style/html.py index ec839fcd..0014c4d9 100644 --- a/pyrogram/client/style/html.py +++ b/pyrogram/client/style/html.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/style/markdown.py b/pyrogram/client/style/markdown.py index f1ea23fc..7bd96ed6 100644 --- a/pyrogram/client/style/markdown.py +++ b/pyrogram/client/style/markdown.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/style/utils.py b/pyrogram/client/style/utils.py index 6a0a9667..b001f1cf 100644 --- a/pyrogram/client/style/utils.py +++ b/pyrogram/client/style/utils.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/types/__init__.py b/pyrogram/client/types/__init__.py index 7b30670f..0f4628ce 100644 --- a/pyrogram/client/types/__init__.py +++ b/pyrogram/client/types/__init__.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # @@ -37,3 +37,4 @@ from .user_and_chats import ( Chat, ChatMember, ChatMembers, ChatPhoto, Dialog, Dialogs, User, UserStatus, ChatPreview ) +from .update import StopPropagation diff --git a/pyrogram/client/types/bots/__init__.py b/pyrogram/client/types/bots/__init__.py index 9f7cc7e6..28cfe724 100644 --- a/pyrogram/client/types/bots/__init__.py +++ b/pyrogram/client/types/bots/__init__.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/types/bots/callback_query.py b/pyrogram/client/types/bots/callback_query.py index c3c23333..62f651d0 100644 --- a/pyrogram/client/types/bots/callback_query.py +++ b/pyrogram/client/types/bots/callback_query.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # @@ -22,10 +22,11 @@ from struct import pack import pyrogram from pyrogram.api import types from ..pyrogram_type import PyrogramType +from ..update import Update from ..user_and_chats import User -class CallbackQuery(PyrogramType): +class CallbackQuery(PyrogramType, Update): """This object represents an incoming callback query from a callback button in an inline keyboard. If the button that originated the query was attached to a message sent by the bot, the field message will be present. If the button was attached to a message sent via the bot (in inline mode), diff --git a/pyrogram/client/types/bots/force_reply.py b/pyrogram/client/types/bots/force_reply.py index 0c15b92a..2e5c2f42 100644 --- a/pyrogram/client/types/bots/force_reply.py +++ b/pyrogram/client/types/bots/force_reply.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/types/bots/inline_keyboard_button.py b/pyrogram/client/types/bots/inline_keyboard_button.py index 655e78f4..f9c1267a 100644 --- a/pyrogram/client/types/bots/inline_keyboard_button.py +++ b/pyrogram/client/types/bots/inline_keyboard_button.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/types/bots/inline_keyboard_markup.py b/pyrogram/client/types/bots/inline_keyboard_markup.py index d958f306..f18bd605 100644 --- a/pyrogram/client/types/bots/inline_keyboard_markup.py +++ b/pyrogram/client/types/bots/inline_keyboard_markup.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/types/bots/keyboard_button.py b/pyrogram/client/types/bots/keyboard_button.py index 4b025375..e93eccb3 100644 --- a/pyrogram/client/types/bots/keyboard_button.py +++ b/pyrogram/client/types/bots/keyboard_button.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/types/bots/reply_keyboard_markup.py b/pyrogram/client/types/bots/reply_keyboard_markup.py index 85f38b10..7840dbe5 100644 --- a/pyrogram/client/types/bots/reply_keyboard_markup.py +++ b/pyrogram/client/types/bots/reply_keyboard_markup.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/types/bots/reply_keyboard_remove.py b/pyrogram/client/types/bots/reply_keyboard_remove.py index def9917c..5b67fbb4 100644 --- a/pyrogram/client/types/bots/reply_keyboard_remove.py +++ b/pyrogram/client/types/bots/reply_keyboard_remove.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/types/input_media/__init__.py b/pyrogram/client/types/input_media/__init__.py index 5f5be30d..e2e0b0f6 100644 --- a/pyrogram/client/types/input_media/__init__.py +++ b/pyrogram/client/types/input_media/__init__.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/types/input_media/input_media.py b/pyrogram/client/types/input_media/input_media.py index 7a380f89..f55d8aa0 100644 --- a/pyrogram/client/types/input_media/input_media.py +++ b/pyrogram/client/types/input_media/input_media.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/types/input_media/input_media_animation.py b/pyrogram/client/types/input_media/input_media_animation.py index 0e7b2433..af0c2b2a 100644 --- a/pyrogram/client/types/input_media/input_media_animation.py +++ b/pyrogram/client/types/input_media/input_media_animation.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/types/input_media/input_media_audio.py b/pyrogram/client/types/input_media/input_media_audio.py index 455c2292..5034ed06 100644 --- a/pyrogram/client/types/input_media/input_media_audio.py +++ b/pyrogram/client/types/input_media/input_media_audio.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/types/input_media/input_media_document.py b/pyrogram/client/types/input_media/input_media_document.py index 08fcae5b..25e17d0f 100644 --- a/pyrogram/client/types/input_media/input_media_document.py +++ b/pyrogram/client/types/input_media/input_media_document.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/types/input_media/input_media_photo.py b/pyrogram/client/types/input_media/input_media_photo.py index c8cdccb8..5917fbf0 100644 --- a/pyrogram/client/types/input_media/input_media_photo.py +++ b/pyrogram/client/types/input_media/input_media_photo.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/types/input_media/input_media_video.py b/pyrogram/client/types/input_media/input_media_video.py index 955cf633..6fa7936e 100644 --- a/pyrogram/client/types/input_media/input_media_video.py +++ b/pyrogram/client/types/input_media/input_media_video.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/types/input_media/input_phone_contact.py b/pyrogram/client/types/input_media/input_phone_contact.py index eacecaf8..1a89759a 100644 --- a/pyrogram/client/types/input_media/input_phone_contact.py +++ b/pyrogram/client/types/input_media/input_phone_contact.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/types/messages_and_media/__init__.py b/pyrogram/client/types/messages_and_media/__init__.py index d402ae48..b6847bdb 100644 --- a/pyrogram/client/types/messages_and_media/__init__.py +++ b/pyrogram/client/types/messages_and_media/__init__.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/types/messages_and_media/animation.py b/pyrogram/client/types/messages_and_media/animation.py index 6b7f7cf7..d5661ea8 100644 --- a/pyrogram/client/types/messages_and_media/animation.py +++ b/pyrogram/client/types/messages_and_media/animation.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/types/messages_and_media/audio.py b/pyrogram/client/types/messages_and_media/audio.py index 148ae805..cfecceae 100644 --- a/pyrogram/client/types/messages_and_media/audio.py +++ b/pyrogram/client/types/messages_and_media/audio.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/types/messages_and_media/contact.py b/pyrogram/client/types/messages_and_media/contact.py index 16dd52bb..51acb59f 100644 --- a/pyrogram/client/types/messages_and_media/contact.py +++ b/pyrogram/client/types/messages_and_media/contact.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/types/messages_and_media/document.py b/pyrogram/client/types/messages_and_media/document.py index db41df6c..e84b5149 100644 --- a/pyrogram/client/types/messages_and_media/document.py +++ b/pyrogram/client/types/messages_and_media/document.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/types/messages_and_media/location.py b/pyrogram/client/types/messages_and_media/location.py index fcdd5e31..64acdbf5 100644 --- a/pyrogram/client/types/messages_and_media/location.py +++ b/pyrogram/client/types/messages_and_media/location.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/types/messages_and_media/message.py b/pyrogram/client/types/messages_and_media/message.py index baeac31f..830a24de 100644 --- a/pyrogram/client/types/messages_and_media/message.py +++ b/pyrogram/client/types/messages_and_media/message.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # @@ -26,11 +26,12 @@ from .location import Location from .message_entity import MessageEntity from ..messages_and_media.photo import Photo from ..pyrogram_type import PyrogramType +from ..update import Update from ..user_and_chats.chat import Chat from ..user_and_chats.user import User -class Message(PyrogramType): +class Message(PyrogramType, Update): """This object represents a message. Args: diff --git a/pyrogram/client/types/messages_and_media/message_entity.py b/pyrogram/client/types/messages_and_media/message_entity.py index 7544424c..88beeb2f 100644 --- a/pyrogram/client/types/messages_and_media/message_entity.py +++ b/pyrogram/client/types/messages_and_media/message_entity.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/types/messages_and_media/messages.py b/pyrogram/client/types/messages_and_media/messages.py index 51d3fbdf..67dc2367 100644 --- a/pyrogram/client/types/messages_and_media/messages.py +++ b/pyrogram/client/types/messages_and_media/messages.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # @@ -22,10 +22,11 @@ import pyrogram from pyrogram.api import types from .message import Message from ..pyrogram_type import PyrogramType +from ..update import Update from ..user_and_chats import Chat -class Messages(PyrogramType): +class Messages(PyrogramType, Update): """This object represents a chat's messages. Args: diff --git a/pyrogram/client/types/messages_and_media/photo.py b/pyrogram/client/types/messages_and_media/photo.py index a52a7aa2..72187761 100644 --- a/pyrogram/client/types/messages_and_media/photo.py +++ b/pyrogram/client/types/messages_and_media/photo.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/types/messages_and_media/photo_size.py b/pyrogram/client/types/messages_and_media/photo_size.py index 7a4db1c2..05f00455 100644 --- a/pyrogram/client/types/messages_and_media/photo_size.py +++ b/pyrogram/client/types/messages_and_media/photo_size.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/types/messages_and_media/poll.py b/pyrogram/client/types/messages_and_media/poll.py index ab59b1ad..72735c28 100644 --- a/pyrogram/client/types/messages_and_media/poll.py +++ b/pyrogram/client/types/messages_and_media/poll.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/types/messages_and_media/poll_option.py b/pyrogram/client/types/messages_and_media/poll_option.py index 240368fc..227fe74f 100644 --- a/pyrogram/client/types/messages_and_media/poll_option.py +++ b/pyrogram/client/types/messages_and_media/poll_option.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/types/messages_and_media/sticker.py b/pyrogram/client/types/messages_and_media/sticker.py index 8b88e7bf..39b140b6 100644 --- a/pyrogram/client/types/messages_and_media/sticker.py +++ b/pyrogram/client/types/messages_and_media/sticker.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/types/messages_and_media/user_profile_photos.py b/pyrogram/client/types/messages_and_media/user_profile_photos.py index 2bfd29c8..8f8525cc 100644 --- a/pyrogram/client/types/messages_and_media/user_profile_photos.py +++ b/pyrogram/client/types/messages_and_media/user_profile_photos.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/types/messages_and_media/venue.py b/pyrogram/client/types/messages_and_media/venue.py index 443f479a..91b3455a 100644 --- a/pyrogram/client/types/messages_and_media/venue.py +++ b/pyrogram/client/types/messages_and_media/venue.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/types/messages_and_media/video.py b/pyrogram/client/types/messages_and_media/video.py index 2c476b39..553e8171 100644 --- a/pyrogram/client/types/messages_and_media/video.py +++ b/pyrogram/client/types/messages_and_media/video.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/types/messages_and_media/video_note.py b/pyrogram/client/types/messages_and_media/video_note.py index 718432fa..bfb88c8d 100644 --- a/pyrogram/client/types/messages_and_media/video_note.py +++ b/pyrogram/client/types/messages_and_media/video_note.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/types/messages_and_media/voice.py b/pyrogram/client/types/messages_and_media/voice.py index b9f799b3..e6bba45b 100644 --- a/pyrogram/client/types/messages_and_media/voice.py +++ b/pyrogram/client/types/messages_and_media/voice.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/types/pyrogram_type.py b/pyrogram/client/types/pyrogram_type.py index f5502a72..3708cdc5 100644 --- a/pyrogram/client/types/pyrogram_type.py +++ b/pyrogram/client/types/pyrogram_type.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/types/update.py b/pyrogram/client/types/update.py new file mode 100644 index 00000000..80c233c0 --- /dev/null +++ b/pyrogram/client/types/update.py @@ -0,0 +1,26 @@ +# Pyrogram - Telegram MTProto API Client Library for Python +# Copyright (C) 2017-2019 Dan Tès +# +# This file is part of Pyrogram. +# +# Pyrogram is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Pyrogram is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with Pyrogram. If not, see . + + +class StopPropagation(StopIteration): + pass + + +class Update: + def stop_propagation(self): + raise StopPropagation diff --git a/pyrogram/client/types/user_and_chats/__init__.py b/pyrogram/client/types/user_and_chats/__init__.py index ec082dfe..24a9a51b 100644 --- a/pyrogram/client/types/user_and_chats/__init__.py +++ b/pyrogram/client/types/user_and_chats/__init__.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/types/user_and_chats/chat.py b/pyrogram/client/types/user_and_chats/chat.py index 7b4240dd..ec30b866 100644 --- a/pyrogram/client/types/user_and_chats/chat.py +++ b/pyrogram/client/types/user_and_chats/chat.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/types/user_and_chats/chat_member.py b/pyrogram/client/types/user_and_chats/chat_member.py index fa43f526..e901e0e1 100644 --- a/pyrogram/client/types/user_and_chats/chat_member.py +++ b/pyrogram/client/types/user_and_chats/chat_member.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/types/user_and_chats/chat_members.py b/pyrogram/client/types/user_and_chats/chat_members.py index 838517ab..88219514 100644 --- a/pyrogram/client/types/user_and_chats/chat_members.py +++ b/pyrogram/client/types/user_and_chats/chat_members.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # @@ -59,8 +59,7 @@ class ChatMembers(PyrogramType): total_count = len(members) for member in members: - user = User._parse(client, users[member.user_id]) - chat_members.append(ChatMember._parse(client, member, user)) + chat_members.append(ChatMember._parse(client, member, users[member.user_id])) return ChatMembers( total_count=total_count, diff --git a/pyrogram/client/types/user_and_chats/chat_photo.py b/pyrogram/client/types/user_and_chats/chat_photo.py index ad4b3151..848f7250 100644 --- a/pyrogram/client/types/user_and_chats/chat_photo.py +++ b/pyrogram/client/types/user_and_chats/chat_photo.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/types/user_and_chats/dialog.py b/pyrogram/client/types/user_and_chats/dialog.py index c001708f..b71caba7 100644 --- a/pyrogram/client/types/user_and_chats/dialog.py +++ b/pyrogram/client/types/user_and_chats/dialog.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/types/user_and_chats/dialogs.py b/pyrogram/client/types/user_and_chats/dialogs.py index 2492d5e2..394ddd28 100644 --- a/pyrogram/client/types/user_and_chats/dialogs.py +++ b/pyrogram/client/types/user_and_chats/dialogs.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/types/user_and_chats/user.py b/pyrogram/client/types/user_and_chats/user.py index 354e8a09..c6ee03e8 100644 --- a/pyrogram/client/types/user_and_chats/user.py +++ b/pyrogram/client/types/user_and_chats/user.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/client/types/user_and_chats/user_status.py b/pyrogram/client/types/user_and_chats/user_status.py index 69c1921b..8c936f8e 100644 --- a/pyrogram/client/types/user_and_chats/user_status.py +++ b/pyrogram/client/types/user_and_chats/user_status.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # @@ -20,9 +20,10 @@ import pyrogram from pyrogram.api import types from ..pyrogram_type import PyrogramType +from ..update import Update -class UserStatus(PyrogramType): +class UserStatus(PyrogramType, Update): """This object represents a User status (Last Seen privacy). .. note:: diff --git a/pyrogram/connection/__init__.py b/pyrogram/connection/__init__.py index 4d1ff9f1..731e7456 100644 --- a/pyrogram/connection/__init__.py +++ b/pyrogram/connection/__init__.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/connection/connection.py b/pyrogram/connection/connection.py index 41f64a40..0c325fae 100644 --- a/pyrogram/connection/connection.py +++ b/pyrogram/connection/connection.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/connection/transport/__init__.py b/pyrogram/connection/transport/__init__.py index 1790ee60..80e0d848 100644 --- a/pyrogram/connection/transport/__init__.py +++ b/pyrogram/connection/transport/__init__.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/connection/transport/tcp/__init__.py b/pyrogram/connection/transport/tcp/__init__.py index ce662e61..6ed12ad8 100644 --- a/pyrogram/connection/transport/tcp/__init__.py +++ b/pyrogram/connection/transport/tcp/__init__.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/connection/transport/tcp/tcp.py b/pyrogram/connection/transport/tcp/tcp.py index 4d8d4a58..debe52bd 100644 --- a/pyrogram/connection/transport/tcp/tcp.py +++ b/pyrogram/connection/transport/tcp/tcp.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/connection/transport/tcp/tcp_abridged.py b/pyrogram/connection/transport/tcp/tcp_abridged.py index 5566b179..56f8d025 100644 --- a/pyrogram/connection/transport/tcp/tcp_abridged.py +++ b/pyrogram/connection/transport/tcp/tcp_abridged.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/connection/transport/tcp/tcp_abridged_o.py b/pyrogram/connection/transport/tcp/tcp_abridged_o.py index 91ee8375..d15d0389 100644 --- a/pyrogram/connection/transport/tcp/tcp_abridged_o.py +++ b/pyrogram/connection/transport/tcp/tcp_abridged_o.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/connection/transport/tcp/tcp_full.py b/pyrogram/connection/transport/tcp/tcp_full.py index 8704247b..36f14adb 100644 --- a/pyrogram/connection/transport/tcp/tcp_full.py +++ b/pyrogram/connection/transport/tcp/tcp_full.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/connection/transport/tcp/tcp_intermediate.py b/pyrogram/connection/transport/tcp/tcp_intermediate.py index aa198db7..e27455d7 100644 --- a/pyrogram/connection/transport/tcp/tcp_intermediate.py +++ b/pyrogram/connection/transport/tcp/tcp_intermediate.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/connection/transport/tcp/tcp_intermediate_o.py b/pyrogram/connection/transport/tcp/tcp_intermediate_o.py index f0598d12..c59deed7 100644 --- a/pyrogram/connection/transport/tcp/tcp_intermediate_o.py +++ b/pyrogram/connection/transport/tcp/tcp_intermediate_o.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/crypto/__init__.py b/pyrogram/crypto/__init__.py index 08ed44f0..a0f66b52 100644 --- a/pyrogram/crypto/__init__.py +++ b/pyrogram/crypto/__init__.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/crypto/aes.py b/pyrogram/crypto/aes.py index f16688c4..de275bd0 100644 --- a/pyrogram/crypto/aes.py +++ b/pyrogram/crypto/aes.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/crypto/kdf.py b/pyrogram/crypto/kdf.py index a0da2e2c..56e52339 100644 --- a/pyrogram/crypto/kdf.py +++ b/pyrogram/crypto/kdf.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/crypto/prime.py b/pyrogram/crypto/prime.py index 8e9426ca..a1b76e67 100644 --- a/pyrogram/crypto/prime.py +++ b/pyrogram/crypto/prime.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/crypto/rsa.py b/pyrogram/crypto/rsa.py index 10302dab..26a9092b 100644 --- a/pyrogram/crypto/rsa.py +++ b/pyrogram/crypto/rsa.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/session/__init__.py b/pyrogram/session/__init__.py index afebf563..3a3107c0 100644 --- a/pyrogram/session/__init__.py +++ b/pyrogram/session/__init__.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/session/auth.py b/pyrogram/session/auth.py index 87817da1..05b20eec 100644 --- a/pyrogram/session/auth.py +++ b/pyrogram/session/auth.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/session/internals/__init__.py b/pyrogram/session/internals/__init__.py index 0d28c8f3..272855a7 100644 --- a/pyrogram/session/internals/__init__.py +++ b/pyrogram/session/internals/__init__.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/session/internals/data_center.py b/pyrogram/session/internals/data_center.py index d36e0613..fd51932a 100644 --- a/pyrogram/session/internals/data_center.py +++ b/pyrogram/session/internals/data_center.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/session/internals/msg_factory.py b/pyrogram/session/internals/msg_factory.py index 76a35458..7d922ec3 100644 --- a/pyrogram/session/internals/msg_factory.py +++ b/pyrogram/session/internals/msg_factory.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/session/internals/msg_id.py b/pyrogram/session/internals/msg_id.py index 99aa9d14..3826aaa5 100644 --- a/pyrogram/session/internals/msg_id.py +++ b/pyrogram/session/internals/msg_id.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/session/internals/seq_no.py b/pyrogram/session/internals/seq_no.py index bef0d1a3..ebc3efea 100644 --- a/pyrogram/session/internals/seq_no.py +++ b/pyrogram/session/internals/seq_no.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/pyrogram/session/session.py b/pyrogram/session/session.py index 0d513430..21bb1133 100644 --- a/pyrogram/session/session.py +++ b/pyrogram/session/session.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. # diff --git a/readthedocs.yml b/readthedocs.yml new file mode 100644 index 00000000..9b172987 --- /dev/null +++ b/readthedocs.yml @@ -0,0 +1,6 @@ +build: + image: latest + +python: + version: 3.6 + setup_py_install: true \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 8f1eea95..227aacf6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ pyaes==1.6.1 pysocks==1.6.8 -typing==3.6.6 \ No newline at end of file +typing==3.6.6; python_version<"3.5" \ No newline at end of file diff --git a/setup.py b/setup.py index 8d1af092..cc2a3880 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,5 @@ # Pyrogram - Telegram MTProto API Client Library for Python -# Copyright (C) 2017-2018 Dan Tès +# Copyright (C) 2017-2019 Dan Tès # # This file is part of Pyrogram. #