We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0d6f8cd commit 580c684Copy full SHA for 580c684
1 file changed
pyrogram/client/methods/chats/export_chat_invite_link.py
@@ -48,18 +48,15 @@ def export_chat_invite_link(
48
49
Raises:
50
RPCError: In case of a Telegram RPC error.
51
+ ValueError: In case the chat_id belongs to a user.
52
"""
53
peer = self.resolve_peer(chat_id)
54
- if isinstance(peer, types.InputPeerChat):
55
+ if isinstance(peer, (types.InputPeerChannel, types.InputPeerChat)):
56
return self.send(
57
functions.messages.ExportChatInvite(
58
peer=peer
59
)
60
).link
- elif isinstance(peer, types.InputPeerChannel):
61
- return self.send(
62
- functions.channels.ExportInvite(
63
- channel=peer
64
- )
65
- ).link
+ else:
+ raise ValueError('The chat_id "{}" belongs to a user'.format(chat_id))
0 commit comments