The conditions and actions for Telegram groups and channels will help automate the processes of adding and removing users according to certain criteria when achieving the specified goal.
Adding a chatbot as an admin to a group or channel
Firstly, you need to add the flow to the group or channel as an administrator. If this is not done, the conditions and actions will not work correctly.
1. Copy the link to the flow or the name of the flow in the @test format
2. Go to group/channel management.
3. In the “Members” or “People” section, you can add a flow to the group/channel.
4. In the “Administrators” section, you can appoint a group/channel member as an administrator.
The “Condition” block for verifying joining a group/channel
1. Setup
In the condition settings, select “User in group/channel” and specify the group/channel ID.
To be able to check if a user is in a group, you have to specify the group/channel ID in the condition.
In open groups/channels, you can use the group name in the @groupname format.
If the group is closed, then insert the ID instead of @groupname. The ID can be copied if you open Telegram in the browser version.
When you are in the group/channel, you will see the group/channel ID in the browser bar.
In some cases, the ID is preceded by the number 100. In order for the conditions to work correctly, you have to delete it.
2. How it works
As soon as the user in the flow reaches the step with this condition, the condition checks that the user is in a group/channel.
If the user is subscribed to the group/channel, the condition will take them to the “YES” branch and continue the pre-configured chain for them.
If the user is not subscribed to the desired group/channel, the condition will take them to the “NO” branch.
We recommend that you assign a tag in the “Action” block so that you can segment users in the future.
The “Actions” block for working with groups and channels
There are 4 items in the list of actions related to groups and channels:
1. Unblock the user — automatically unblocks the user, removing them from the blacklist of the group / channel.
2. Exclude from the group/channel — delete the user and add them to the blacklist.
3. Confirm the application to join — automatic confirmation of the application to join a group or channel when the user reaches the current step in the flow.
4. Reject the application to join — automatically reject the application to join a group or channel when the current step in the flow is reached.
Important! The user has to apply to join a group or channel on their own. You can only send them an invite link.
Actions related to Telegram groups and channels, as well as other actions, can be set as a separate block in the flow or set up in a button, if necessary.
Example
A simple chain in the flow with automated user entry into the group/channel and automatic confirmation of entry will work this way:
1. Message 6, which will provide a link to join the group.
2. Delay 2 by N hours/minutes/days.
3. Message 7 with a link to pay for a subscription to join the group. On the payment page, you need to assign a unique tag in order to track the payment by the user.
4. Delay 3 by N hours/minutes/days.
5. Condition 3 with verification of the tag that is assigned on the payment page after a successful payment.
6. Depending on the payment:
- if the payment was not successful, then proceed to the step with Message 9 that the payment was not successful or was not completed. And after that, return to Delay 3 before Condition 3 with the verification of the payment tag;
- if the payment is successful, then proceed to Action 5 with the approval of the user joining the group/channel.
7. Message 8 notifying about the successful joining of the group/channel.
If you need to delete messages for a person after their exclusion from the group, use the “Delete all messages from the chat” checkbox.
The subscription verification flow template is available at the link.
Video review of this template:
Video on YouTube
If you haven’t found the answer to your question, contact us in the chat in your profile or email [email protected]😃
Get 14 days of full functionality of BotHelp, a platform for creating broadcasting, autofunnels, and chatbots.