mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-16 12:51:18 +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)
|
||||
|
||||
if isinstance(peer, types.InputPeerChat):
|
||||
if isinstance(peer, (types.InputPeerChat, types.InputPeerChannel)):
|
||||
return self.send(
|
||||
functions.messages.ExportChatInvite(
|
||||
peer=peer
|
||||
)
|
||||
).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