Skip to content

Commit 2aad598

Browse files
committed
Fix export_chat_invite_link broken because of Layer update
Fixes #244
1 parent 16d3b2d commit 2aad598

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

pyrogram/client/methods/chats/export_chat_invite_link.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,11 @@ def export_chat_invite_link(
4444
"""
4545
peer = self.resolve_peer(chat_id)
4646

47-
if isinstance(peer, types.InputPeerChat):
47+
if isinstance(peer, (types.InputPeerChat, types.InputPeerChannel)):
4848
return self.send(
4949
functions.messages.ExportChatInvite(
50-
peer=peer.chat_id
51-
)
52-
).link
53-
elif isinstance(peer, types.InputPeerChannel):
54-
return self.send(
55-
functions.channels.ExportInvite(
56-
channel=peer
50+
peer=peer
5751
)
5852
).link
53+
else:
54+
raise ValueError("The chat_id \"{}\" belongs to a user".format(chat_id))

0 commit comments

Comments
 (0)