mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-24 15:59:18 +00:00
Revert "Fix export_chat_invite_link broken because of Layer update Fixes #244"
This reverts commit 2aad5985
This commit is contained in:
parent
2aad59856d
commit
d83a2a951d
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user