mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 13:27:47 +00:00
Add export_chat_invite_link method
This commit is contained in:
parent
e242f2a555
commit
4019693363
@ -1027,3 +1027,19 @@ class Client:
|
|||||||
)
|
)
|
||||||
|
|
||||||
return r
|
return r
|
||||||
|
|
||||||
|
def export_chat_invite_link(self, chat_id: int or str):
|
||||||
|
peer = self.resolve_peer(chat_id)
|
||||||
|
|
||||||
|
if isinstance(peer, types.InputPeerChat):
|
||||||
|
return self.send(
|
||||||
|
functions.messages.ExportChatInvite(
|
||||||
|
chat_id=peer.chat_id
|
||||||
|
)
|
||||||
|
).link
|
||||||
|
elif isinstance(peer, types.InputPeerChannel):
|
||||||
|
return self.send(
|
||||||
|
functions.channels.ExportInvite(
|
||||||
|
channel=peer
|
||||||
|
)
|
||||||
|
).link
|
||||||
|
Loading…
x
Reference in New Issue
Block a user