Use this method to create an additional invite link for a chat. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. The link can be revoked using the method revokeChatInviteLink. Returns the new invite lin
(
self, chat_id: Union[int, str],
name: Optional[str]=None,
expire_date: Optional[Union[int, datetime]]=None,
member_limit: Optional[int]=None,
creates_join_request: Optional[bool]=None)
| 4899 | |
| 4900 | |
| 4901 | def create_chat_invite_link( |
| 4902 | self, chat_id: Union[int, str], |
| 4903 | name: Optional[str]=None, |
| 4904 | expire_date: Optional[Union[int, datetime]]=None, |
| 4905 | member_limit: Optional[int]=None, |
| 4906 | creates_join_request: Optional[bool]=None) -> types.ChatInviteLink: |
| 4907 | """ |
| 4908 | Use this method to create an additional invite link for a chat. The bot must be an administrator in the chat for this to work and |
| 4909 | must have the appropriate administrator rights. |
| 4910 | The link can be revoked using the method revokeChatInviteLink. |
| 4911 | Returns the new invite link as ChatInviteLink object. |
| 4912 | |
| 4913 | Telegram documentation: https://core.telegram.org/bots/api#createchatinvitelink |
| 4914 | |
| 4915 | :param chat_id: Id: Unique identifier for the target chat or username of the target channel |
| 4916 | (in the format @channelusername) |
| 4917 | :type chat_id: :obj:`int` or :obj:`str` |
| 4918 | |
| 4919 | :param name: Invite link name; 0-32 characters |
| 4920 | :type name: :obj:`str` |
| 4921 | |
| 4922 | :param expire_date: Point in time (Unix timestamp) when the link will expire |
| 4923 | :type expire_date: :obj:`int` or :obj:`datetime` |
| 4924 | |
| 4925 | :param member_limit: Maximum number of users that can be members of the chat simultaneously |
| 4926 | :type member_limit: :obj:`int` |
| 4927 | |
| 4928 | :param creates_join_request: True, if users joining the chat via the link need to be approved by chat administrators. If True, member_limit can't be specified |
| 4929 | :type creates_join_request: :obj:`bool` |
| 4930 | |
| 4931 | :return: Returns the new invite link as ChatInviteLink object. |
| 4932 | :rtype: :class:`telebot.types.ChatInviteLink` |
| 4933 | """ |
| 4934 | return types.ChatInviteLink.de_json( |
| 4935 | apihelper.create_chat_invite_link(self.token, chat_id, name, expire_date, member_limit, creates_join_request) |
| 4936 | ) |
| 4937 | |
| 4938 | |
| 4939 | def edit_chat_invite_link( |