mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 20:14:51 +00:00
Revert "Fix export_chat_invite_link broken because of Layer update Fixes #244"
This reverts commit 2aad5985
This commit is contained in:
parent
2aad59856d
commit
d83a2a951d
1 changed files with 8 additions and 4 deletions
|
|
@ -44,11 +44,15 @@ class ExportChatInviteLink(BaseClient):
|
|||
"""
|
||||
peer = self.resolve_peer(chat_id)
|
||||
|
||||
if isinstance(peer, (types.InputPeerChat, types.InputPeerChannel)):
|
||||
if isinstance(peer, types.InputPeerChat):
|
||||
return self.send(
|
||||
functions.messages.ExportChatInvite(
|
||||
peer=peer
|
||||
peer=peer.chat_id
|
||||
)
|
||||
).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 a new issue