parent
16d3b2d56e
commit
2aad59856d
@ -44,15 +44,11 @@ class ExportChatInviteLink(BaseClient):
|
|||||||
"""
|
"""
|
||||||
peer = self.resolve_peer(chat_id)
|
peer = self.resolve_peer(chat_id)
|
||||||
|
|
||||||
if isinstance(peer, types.InputPeerChat):
|
if isinstance(peer, (types.InputPeerChat, types.InputPeerChannel)):
|
||||||
return self.send(
|
return self.send(
|
||||||
functions.messages.ExportChatInvite(
|
functions.messages.ExportChatInvite(
|
||||||
peer=peer.chat_id
|
peer=peer
|
||||||
)
|
|
||||||
).link
|
|
||||||
elif isinstance(peer, types.InputPeerChannel):
|
|
||||||
return self.send(
|
|
||||||
functions.channels.ExportInvite(
|
|
||||||
channel=peer
|
|
||||||
)
|
)
|
||||||
).link
|
).link
|
||||||
|
else:
|
||||||
|
raise ValueError("The chat_id \"{}\" belongs to a user".format(chat_id))
|
||||||
|
Loading…
Reference in New Issue
Block a user