From b74a8eba5e02390f58375590c7a73dbc234b07f3 Mon Sep 17 00:00:00 2001 From: ColinShark Date: Tue, 20 Aug 2019 10:12:55 +0200 Subject: [PATCH] Add bound method for get_common_chats (#305) --- pyrogram/client/types/user_and_chats/user.py | 51 ++++++++++++++------ 1 file changed, 37 insertions(+), 14 deletions(-) diff --git a/pyrogram/client/types/user_and_chats/user.py b/pyrogram/client/types/user_and_chats/user.py index 783c0566..2be1f561 100644 --- a/pyrogram/client/types/user_and_chats/user.py +++ b/pyrogram/client/types/user_and_chats/user.py @@ -279,21 +279,21 @@ class User(Object, Update): def block(self): """Bound method *block* of :obj:`User`. - + Use as a shortcut for: - + .. code-block:: python - + client.block_user(123456789) - + Example: .. code-block:: python - + user.block() - + Returns: True on success. - + Raises: RPCError: In case of a Telegram RPC error. """ @@ -302,23 +302,46 @@ class User(Object, Update): def unblock(self): """Bound method *unblock* of :obj:`User`. - + Use as a shortcut for: - + .. code-block:: python - + client.unblock_user(123456789) - + Example: .. code-block:: python - + user.unblock() - + Returns: True on success. - + Raises: RPCError: In case of a Telegram RPC error. """ return self._client.unblock_user(self.id) + + def get_common_chats(self): + """Bound method *get_common_chats* of :obj:`User`. + + Use as a shortcut for: + + .. code-block:: python + + client.get_common_chats(123456789) + + Example: + .. code-block:: python + + user.get_common_chats() + + Returns: + True on success. + + Raises: + RPCError: In case of a Telegram RPC error. + """ + + return self._client.get_common_chats(self.id)