Skip to content

Commit 29b4615

Browse files
committed
Update create/edit_chat_invite_link
1 parent 56e7e11 commit 29b4615

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

pyrogram/methods/invite_links/create_chat_invite_link.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ class CreateChatInviteLink(Scaffold):
2727
async def create_chat_invite_link(
2828
self,
2929
chat_id: Union[int, str],
30+
name: str = None,
3031
expire_date: int = None,
3132
member_limit: int = None,
33+
creates_join_request: bool = None
3234
) -> "types.ChatInviteLink":
3335
"""Create an additional invite link for a chat.
3436
@@ -41,6 +43,9 @@ async def create_chat_invite_link(
4143
Unique identifier for the target chat or username of the target channel/supergroup
4244
(in the format @username).
4345
46+
name (``str``, *optional*):
47+
Invite link name.
48+
4449
expire_date (``int``, *optional*):
4550
Point in time (Unix timestamp) when the link will expire.
4651
Defaults to None (no expiration date).
@@ -50,6 +55,10 @@ async def create_chat_invite_link(
5055
this invite link; 1-99999.
5156
Defaults to None (no member limit).
5257
58+
creates_join_request (``bool``, *optional*):
59+
True, if users joining the chat via the link need to be approved by chat administrators.
60+
If True, member_limit can't be specified.
61+
5362
Returns:
5463
:obj:`~pyrogram.types.ChatInviteLink`: On success, the new invite link is returned.
5564
@@ -67,6 +76,8 @@ async def create_chat_invite_link(
6776
peer=await self.resolve_peer(chat_id),
6877
expire_date=expire_date,
6978
usage_limit=member_limit,
79+
title=name,
80+
request_needed=creates_join_request
7081
)
7182
)
7283

pyrogram/methods/invite_links/edit_chat_invite_link.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ async def edit_chat_invite_link(
2828
self,
2929
chat_id: Union[int, str],
3030
invite_link: str,
31+
name: str = None,
3132
expire_date: int = None,
3233
member_limit: int = None,
34+
creates_join_request: bool = None
3335
) -> "types.ChatInviteLink":
3436
"""Edit a non-primary invite link.
3537
@@ -43,6 +45,9 @@ async def edit_chat_invite_link(
4345
invite_link (``str``):
4446
The invite link to edit
4547
48+
name (``str``, *optional*):
49+
Invite link name.
50+
4651
expire_date (``int``, *optional*):
4752
Point in time (Unix timestamp) when the link will expire.
4853
Defaults to None (no change), pass 0 to set no expiration date.
@@ -52,6 +57,10 @@ async def edit_chat_invite_link(
5257
invite link; 1-99999.
5358
Defaults to None (no change), pass 0 to set no member limit.
5459
60+
creates_join_request (``bool``, *optional*):
61+
True, if users joining the chat via the link need to be approved by chat administrators.
62+
If True, member_limit can't be specified.
63+
5564
Returns:
5665
:obj:`~pyrogram.types.ChatInviteLink`: On success, the new invite link is returned
5766
@@ -70,6 +79,8 @@ async def edit_chat_invite_link(
7079
link=invite_link,
7180
expire_date=expire_date,
7281
usage_limit=member_limit,
82+
title=name,
83+
request_needed=creates_join_request
7384
)
7485
)
7586

0 commit comments

Comments
 (0)