From d83a2a951d72b8b9cfbc67a166ac953851774a88 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Tue, 30 Apr 2019 11:22:23 +0200 Subject: [PATCH] Revert "Fix export_chat_invite_link broken because of Layer update Fixes #244" This reverts commit 2aad5985 --- .../client/methods/chats/export_chat_invite_link.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pyrogram/client/methods/chats/export_chat_invite_link.py b/pyrogram/client/methods/chats/export_chat_invite_link.py index c9c7ca41..b84b1d3c 100644 --- a/pyrogram/client/methods/chats/export_chat_invite_link.py +++ b/pyrogram/client/methods/chats/export_chat_invite_link.py @@ -44,11 +44,15 @@ class ExportChatInviteLink(BaseClient): """ peer = self.resolve_peer(chat_id) - if isinstance(peer, (types.InputPeerChat, types.InputPeerChannel)): + if isinstance(peer, types.InputPeerChat): return self.send( functions.messages.ExportChatInvite( - peer=peer + peer=peer.chat_id + ) + ).link + elif isinstance(peer, types.InputPeerChannel): + return self.send( + functions.channels.ExportInvite( + channel=peer ) ).link - else: - raise ValueError("The chat_id \"{}\" belongs to a user".format(chat_id))