From 937987a361179491161fc75fc0b8e56efc237c48 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sat, 3 Aug 2019 19:40:45 +0200 Subject: [PATCH] Finally remove ports from older schemas and fix export_chat_invite_link --- pyrogram/client/methods/chats/export_chat_invite_link.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/pyrogram/client/methods/chats/export_chat_invite_link.py b/pyrogram/client/methods/chats/export_chat_invite_link.py index bf5d3a38..46886469 100644 --- a/pyrogram/client/methods/chats/export_chat_invite_link.py +++ b/pyrogram/client/methods/chats/export_chat_invite_link.py @@ -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))