Update create/edit_chat_invite_link
This commit is contained in:
parent
56e7e11037
commit
29b4615848
@ -27,8 +27,10 @@ class CreateChatInviteLink(Scaffold):
|
|||||||
async def create_chat_invite_link(
|
async def create_chat_invite_link(
|
||||||
self,
|
self,
|
||||||
chat_id: Union[int, str],
|
chat_id: Union[int, str],
|
||||||
|
name: str = None,
|
||||||
expire_date: int = None,
|
expire_date: int = None,
|
||||||
member_limit: int = None,
|
member_limit: int = None,
|
||||||
|
creates_join_request: bool = None
|
||||||
) -> "types.ChatInviteLink":
|
) -> "types.ChatInviteLink":
|
||||||
"""Create an additional invite link for a chat.
|
"""Create an additional invite link for a chat.
|
||||||
|
|
||||||
@ -41,6 +43,9 @@ class CreateChatInviteLink(Scaffold):
|
|||||||
Unique identifier for the target chat or username of the target channel/supergroup
|
Unique identifier for the target chat or username of the target channel/supergroup
|
||||||
(in the format @username).
|
(in the format @username).
|
||||||
|
|
||||||
|
name (``str``, *optional*):
|
||||||
|
Invite link name.
|
||||||
|
|
||||||
expire_date (``int``, *optional*):
|
expire_date (``int``, *optional*):
|
||||||
Point in time (Unix timestamp) when the link will expire.
|
Point in time (Unix timestamp) when the link will expire.
|
||||||
Defaults to None (no expiration date).
|
Defaults to None (no expiration date).
|
||||||
@ -50,6 +55,10 @@ class CreateChatInviteLink(Scaffold):
|
|||||||
this invite link; 1-99999.
|
this invite link; 1-99999.
|
||||||
Defaults to None (no member limit).
|
Defaults to None (no member limit).
|
||||||
|
|
||||||
|
creates_join_request (``bool``, *optional*):
|
||||||
|
True, if users joining the chat via the link need to be approved by chat administrators.
|
||||||
|
If True, member_limit can't be specified.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
:obj:`~pyrogram.types.ChatInviteLink`: On success, the new invite link is returned.
|
:obj:`~pyrogram.types.ChatInviteLink`: On success, the new invite link is returned.
|
||||||
|
|
||||||
@ -67,6 +76,8 @@ class CreateChatInviteLink(Scaffold):
|
|||||||
peer=await self.resolve_peer(chat_id),
|
peer=await self.resolve_peer(chat_id),
|
||||||
expire_date=expire_date,
|
expire_date=expire_date,
|
||||||
usage_limit=member_limit,
|
usage_limit=member_limit,
|
||||||
|
title=name,
|
||||||
|
request_needed=creates_join_request
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -28,8 +28,10 @@ class EditChatInviteLink(Scaffold):
|
|||||||
self,
|
self,
|
||||||
chat_id: Union[int, str],
|
chat_id: Union[int, str],
|
||||||
invite_link: str,
|
invite_link: str,
|
||||||
|
name: str = None,
|
||||||
expire_date: int = None,
|
expire_date: int = None,
|
||||||
member_limit: int = None,
|
member_limit: int = None,
|
||||||
|
creates_join_request: bool = None
|
||||||
) -> "types.ChatInviteLink":
|
) -> "types.ChatInviteLink":
|
||||||
"""Edit a non-primary invite link.
|
"""Edit a non-primary invite link.
|
||||||
|
|
||||||
@ -43,6 +45,9 @@ class EditChatInviteLink(Scaffold):
|
|||||||
invite_link (``str``):
|
invite_link (``str``):
|
||||||
The invite link to edit
|
The invite link to edit
|
||||||
|
|
||||||
|
name (``str``, *optional*):
|
||||||
|
Invite link name.
|
||||||
|
|
||||||
expire_date (``int``, *optional*):
|
expire_date (``int``, *optional*):
|
||||||
Point in time (Unix timestamp) when the link will expire.
|
Point in time (Unix timestamp) when the link will expire.
|
||||||
Defaults to None (no change), pass 0 to set no expiration date.
|
Defaults to None (no change), pass 0 to set no expiration date.
|
||||||
@ -52,6 +57,10 @@ class EditChatInviteLink(Scaffold):
|
|||||||
invite link; 1-99999.
|
invite link; 1-99999.
|
||||||
Defaults to None (no change), pass 0 to set no member limit.
|
Defaults to None (no change), pass 0 to set no member limit.
|
||||||
|
|
||||||
|
creates_join_request (``bool``, *optional*):
|
||||||
|
True, if users joining the chat via the link need to be approved by chat administrators.
|
||||||
|
If True, member_limit can't be specified.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
:obj:`~pyrogram.types.ChatInviteLink`: On success, the new invite link is returned
|
:obj:`~pyrogram.types.ChatInviteLink`: On success, the new invite link is returned
|
||||||
|
|
||||||
@ -70,6 +79,8 @@ class EditChatInviteLink(Scaffold):
|
|||||||
link=invite_link,
|
link=invite_link,
|
||||||
expire_date=expire_date,
|
expire_date=expire_date,
|
||||||
usage_limit=member_limit,
|
usage_limit=member_limit,
|
||||||
|
title=name,
|
||||||
|
request_needed=creates_join_request
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user