mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 13:27:47 +00:00
Finally remove ports from older schemas and fix export_chat_invite_link
This commit is contained in:
parent
c8c93b9ce6
commit
937987a361
@ -57,17 +57,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
|
peer=peer
|
||||||
)
|
)
|
||||||
).link
|
).link
|
||||||
elif isinstance(peer, types.InputPeerChannel):
|
|
||||||
return self.send(
|
|
||||||
functions.channels.ExportInvite(
|
|
||||||
channel=peer
|
|
||||||
)
|
|
||||||
).link
|
|
||||||
else:
|
else:
|
||||||
raise ValueError('The chat_id "{}" belongs to a user'.format(chat_id))
|
raise ValueError('The chat_id "{}" belongs to a user'.format(chat_id))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user