diff --git a/docs/source/start/Installation.rst b/docs/source/start/Installation.rst new file mode 100644 index 00000000..8aea16de --- /dev/null +++ b/docs/source/start/Installation.rst @@ -0,0 +1,50 @@ +Installation +============ + +Being a Python library, Pyrogram requires Python to be installed in your system. +We recommend using the latest version of Python 3 and pip. + +Get Python 3 from https://www.python.org/downloads/ or with your package manager and pip +by following the instructions at https://pip.pypa.io/en/latest/installing/. + +Pyrogram supports Python 3 only, starting from version 3.4 and PyPy. + +Install Pyrogram +---------------- + +- The easiest way to install and upgrade Pyrogram is by using **pip**: + + .. code-block:: bash + + $ pip3 install --upgrade pyrogram + +- or, with TgCrypto_ (recommended): + + .. code-block:: bash + + $ pip3 install --upgrade pyrogram[tgcrypto] + +Bleeding Edge +------------- + +If you want the latest development version of Pyrogram, you can install it straight from the develop_ +branch using this command: + +.. code-block:: bash + + $ pip3 install --upgrade git+https://github.com/pyrogram/pyrogram.git + +Verifying +--------- + +To verify that Pyrogram is correctly installed, open a Python shell and import it. +If no error shows up you are good to go. + +.. code-block:: bash + + >>> import pyrogram + >>> pyrogram.__version__ + '0.7.5' + +.. _TgCrypto: https://docs.pyrogram.ml/resources/TgCrypto +.. _develop: http://github.com/pyrogram/pyrogram \ No newline at end of file diff --git a/docs/source/start/QuickInstallation.rst b/docs/source/start/QuickInstallation.rst deleted file mode 100644 index f0400207..00000000 --- a/docs/source/start/QuickInstallation.rst +++ /dev/null @@ -1,37 +0,0 @@ -Quick Installation -================== - -- The easiest way to install and upgrade Pyrogram is by using **pip**: - - .. code-block:: bash - - $ pip3 install --upgrade pyrogram - -- or, with TgCrypto_ (recommended): - - .. code-block:: bash - - $ pip3 install --upgrade pyrogram[tgcrypto] - -Bleeding Edge -------------- - -If you want the latest development version of the library, you can install it with: - -.. code-block:: bash - - $ pip3 install --upgrade git+https://github.com/pyrogram/pyrogram.git - -Verifying ---------- - -To verify that Pyrogram is correctly installed, open a Python shell and import it. -If no error shows up you are good to go. - -.. code-block:: bash - - >>> import pyrogram - >>> pyrogram.__version__ - '0.7.4' - -.. _TgCrypto: https://docs.pyrogram.ml/resources/TgCrypto \ No newline at end of file diff --git a/pyrogram/api/errors/__init__.py b/pyrogram/api/errors/__init__.py index 0ed04e02..3f7961dd 100644 --- a/pyrogram/api/errors/__init__.py +++ b/pyrogram/api/errors/__init__.py @@ -16,5 +16,5 @@ # You should have received a copy of the GNU Lesser General Public License # along with Pyrogram. If not, see . -from .exceptions import * from .error import UnknownError +from .exceptions import * diff --git a/pyrogram/client/handlers/disconnect_handler.py b/pyrogram/client/handlers/disconnect_handler.py index 71123248..9ad4ffbc 100644 --- a/pyrogram/client/handlers/disconnect_handler.py +++ b/pyrogram/client/handlers/disconnect_handler.py @@ -34,5 +34,6 @@ class DisconnectHandler(Handler): The Client itself. Useful, for example, when you want to change the proxy before a new connection is established. """ + def __init__(self, callback: callable): super().__init__(callback) diff --git a/pyrogram/client/types/__init__.py b/pyrogram/client/types/__init__.py index 5431b89e..acd001dd 100644 --- a/pyrogram/client/types/__init__.py +++ b/pyrogram/client/types/__init__.py @@ -30,6 +30,7 @@ from .input_phone_contact import InputPhoneContact from .location import Location from .message import Message from .message_entity import MessageEntity +from .messages import Messages from .photo_size import PhotoSize from .reply_markup import ( ForceReply, InlineKeyboardButton, InlineKeyboardMarkup, @@ -43,4 +44,3 @@ from .venue import Venue from .video import Video from .video_note import VideoNote from .voice import Voice -from .messages import Messages