Finally remove ports from older schemas and fix export_chat_invite_link

This commit is contained in:
Dan 2019-08-03 19:40:45 +02:00
parent c8c93b9ce6
commit 937987a361

View File

@ -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))