Revert "Fix export_chat_invite_link broken because of Layer update Fixes #244"

This reverts commit 2aad5985
This commit is contained in:
Dan 2019-04-30 11:22:23 +02:00
parent 2aad59856d
commit d83a2a951d

View File

@ -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))