Action: Create chat link¶
Generates a personalized link for users to join a channel or group. You can configure options such as expiration date, member limit, and more.
Requirements¶
For this action to work correctly, your bot must:
- Be an administrator of the target channel or group.
- Have the
Invite Users via Linkpermission enabled.
How to configure the action?¶
1. Create the action¶
- Go to your bot and press
🛠 Editto enter editor mode. - Select the button or command where you want to add this action, or create a new one.
- Click on
Actions 🌟→🎯 New action→🔗 Create chat link. - Click on
Configure 🛠to set it up.
2. Configure the options¶
➡️ Channel or group¶
The @username or ID of the channel or group where the link will be generated.
➡️ Name (optional)¶
An identifier to easily recognize the link in the future.
➡️ Expiration (optional)¶
The date when the link will no longer be valid. Use the format DD-MM-YYYY HH:MM:SS (the time is optional). If not specified, the link will be permanent.
➡️ Member limit (optional)¶
The maximum number of users who can join using the link. It must be a number between 1 and 99999. If not specified, there will be no limit.
➡️ Request to join (yes | no) (optional)¶
If enabled, users using the link will need administrator approval to join. If this option is active, you cannot set a member limit.
3. Activate the action¶
Click ✅ Activate to activate this action and make it functional.
What does the action return through its ID?¶
You can retrieve the generated link using:
#ActionID.link#
Replace
ActionIDwith the Action ID of this action (Create chat link).
Practical example: Creating a link for a channel¶
In this example, we will create a join link for a channel.
Prerequisite
Before proceeding, add your bot as an administrator to the channel from which you will generate a link, with the Invite Users via Link permission.
1. Create a new button¶
- Enter edit mode by clicking
🛠 Editin your bot. - Click on
✳️ New button | command. - Enter the button name, for example:
Create link. - Click on
Actions 🌟to configure the actions for this button.
2. Add the necessary actions¶
a) Action 1: Create chat link¶
- Click on
🎯 New actionand select🔗 Create chat link. - Click on
Configure 🛠→📢 Channel or group 📢and enter the@usernameor ID of the channel. - Return to the actions menu and activate this action by clicking
✅ Activate. - Copy the Action ID of this action, as you will need it in a moment.
b) Action 2: Send message¶
- Click on
🎯 New action→✉️ Send message. -
Click on
Configure 🛠→💬 Set message 💬and enter:The generated link is: {#ActionID.link#}Replace
ActionIDwith the Action ID of theCreate chat linkaction that you just copied. -
Return to the actions menu and activate this action by clicking
✅ Activate.
Final result¶
- The user clicks the
Create linkbutton. - The bot generates a personalized link and sends it to the user.