From c9b1e09348155aca6640a23edee55c09b95311e8 Mon Sep 17 00:00:00 2001 From: ColinShark Date: Sat, 10 Aug 2019 00:54:22 +0200 Subject: [PATCH] Add export_invite_link bound method (#300) --- pyrogram/client/types/user_and_chats/chat.py | 24 ++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/pyrogram/client/types/user_and_chats/chat.py b/pyrogram/client/types/user_and_chats/chat.py index 546485f6..b32dc3e7 100644 --- a/pyrogram/client/types/user_and_chats/chat.py +++ b/pyrogram/client/types/user_and_chats/chat.py @@ -714,3 +714,27 @@ class Chat(Object): """ return self._client.leave_chat(self.id) + + + def export_invite_link(self): + """Bound method *export_invite_link* of :obj:`Chat`. + + Use as a shortcut for: + + .. code-block:: python + + client.export_chat_invite_link(123456789) + + Example: + .. code-block:: python + + chat.export_invite_link() + + Returns: + ``str``: On success, the exported invite link is returned. + + Raises: + ValueError: In case the chat_id belongs to a user. + """ + + return self._client.export_invite_link(self.id)