Conditions and actions for Telegram groups and channels will help automate the process of adding and removing users according to certain criteria when a specified goal is achieved.
Adding a chatbot as an admin to a group or channel
First of all, you need to add the bot to the group or channel as an administrator. If you do not do this, the conditions and actions will not work correctly.
1. Copy the bot link or bot name in the @test format
2. Go to group/channel management.
3. In the "Members" or "Subscribers" section, you can add the bot to a group/channel.
4. In the "Administrators" section, you can assign a group/channel member as an administrator.
Block "Condition" for checking joining a group/channel
1. Setting
In the condition settings, select "User in group/channel" and specify the group/channel ID.
To be able to check whether a user is in a group, you need to specify the group/channel ID the condition
Where can I get a group/channel ID?
In open groups/channels, you can use the group name in the format @groupname.
If the group is closed, then instead of @groupname, insert the ID. The ID can be copied if you open Telegram in the browser version .
When you are in a group/channel, you will see the group/channel ID in the browser bar.
In some cases, the number 100 appears before the ID. For the conditions to work correctly, it must be removed.
2. How it works
Once the user in the bot reaches the step with this condition, the condition will check that the user is in the group/channel.
If the user is subscribed to a group/channel, the condition will take him to the “YES” branch and continue the previously configured chain for him.
If the user is not subscribed to the required group/channel, the condition will display it in the "NO" branch.
We recommend assigning a label in the Action block so that you can segment users in the future.
Actions block for working with groups and channels
There are 4 items in the action list related to groups and channels:
1. Unblock user — automatically unblocks the user, removes them from the group/channel blacklist.
2. Exclude from group/channel — removes the user and adds them to the blacklist.
3. Confirm membership request — automatically confirms the request to join the group or channel when the user reaches the current step in the bot.
4. Reject membership request — automatically rejects the request to join the group or channel when the current step in the bot is reached.
Important! The user must submit an application to join a group or channel themselves. You can only send them a link to join.
Actions related to Telegram groups and channels, like other actions, can be placed as a separate block in the bot or configured as a button, if necessary.
Example
A simple chain in a bot with automated user entry into a group/channel and automatic confirmation of entry will work like this:
1. Message 6 , which will provide a link to join the group.
2. Delay 2 for 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 label to track the user's payment.
4. Delay 3 for N hours/minutes/days.
5. Condition 3 with a check of the label, which is assigned on the payment page after successful payment.
6. Depending on the payment:
- if the payment was not successful, then go to step with Message 9 that the payment was not successful or was not made. And then return to Delay 3 before Condition 3 with a check of the payment label;
- If the payment was successful, then proceed to Action 5 with approval of the user joining the group/channel.
7. Message 8 with notification of successful joining of a group/channel.
If you need to delete messages for a subscriber after excluding him from the group, use the checkbox " Delete all messages from chat" .
The template for the subscription verification bot is available at the link .
Video review of this template:
If you have not found the answer to your question, ask us in the chat inside your account or write to BotHelpSupportBot or to hello@bothelp.io
Get 14 days of full functionality of the platform for creating mailings, autofunnels and chatbots BotHelp.