edit_chat_invite_link()

Edit a non-primary invite link.

You must be an administrator in the chat for this to work and must have the appropriate admin rights.

Usable by Users Bots
  • chat_id (int | str) – Unique identifier for the target chat or username of the target channel/supergroup (in the format @username). You can also use chat public link in form of t.me/<username> (str).

  • invite_link (str) – The invite link to edit

  • name (str, optional) – Invite link name.

  • expire_date (datetime, optional) – Point in time when the link will expire. Defaults to None (no change), pass None to set no expiration date.

  • member_limit (int, optional) – Maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999. 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.

ChatInviteLink – On success, the new invite link is returned

Example

# Edit the member limit of a link
link = await app.edit_chat_invite_link(chat_id, invite_link, member_limit=5)

# Set no expiration date of a link
link = await app.edit_chat_invite_link(chat_id, invite_link, expire_date=0)