In our kind of service, sometimes you have to let the client and the author talk to each other directly.
But it is necessary to be anonymous so that they cannot see each other and write to each other directly. At the same time, it should be possible for the agent to help them and intervene in negotiations if necessary. If you have a similar task, this scenario will work for you.
Creating groups in Telegram
- The first thing to do is to create 2 groups. In the first group will be the agent and the client. Group 2 will be for the agent and the author. In this case, the groups act as “rooms”, where new users come, get a service, and then get deleted. New users do not see the old messages (excepting their own, if they have been added twice or more).
- Add your bot in both chats (better to create a separate bot for this scenario), make him the administrator. The group will be converted to a supergroup.
- Find out the id of each group using @myidbot or other bots for this.
- Add description, logo, and other info to the groups.
Implementing the scenario in Integromat
Here is what this scenario would look like if there are 3 agents and they have 5 pairs of chats in total. All this is handled by 1 bot. The bot copies a message from 1 chat and sends it to 2 chat.
Let’s look at an example with 1 pair of chats.
Creating Telegram Watch Updates module
Go to Integromat, create a scenario. The first module Telegram -> Watch updates. Connect the bot there. Further, with any action in chats, where the bot is added, a notification will come here.
Further, if there are several agents and several chats, set filters, so that the bot posts in chats of the desired agent. If the agent is only one, then skip this point.
Next, to cut off all unnecessary notifications, you need to put filters on the type of message. And specifically, I am interested in only 6 of them:
Creating network of routers
Make a router and put a verification for “not empty” messages with the types written above.
Here are two screenshots with examples of text and photo filters.
Let’s say we put filters on the type of message. Next, we need to put filters on the id of the chat.
- If the notification came to chat 1, then copy and send the message to chat 2
- If the notification came to chat 2, then copy and paste the message to chat 1
This is what the filter looks like:
And this is what the final text message module might look like after the filter:
For each type of message, you need to create different Telegram modules. For example, Send a Text Message, Send a Photo, Send a Document, etc.
Here, if a packet reached this module, it means the message was a text or photo or document message, it’s in the client’s chat, and it needs to be forwarded to the author’s chat.
The text of the message will be the text from the client chat message.
- It is either the client’s message, then the Client: will be added before the message.
- If the message is from an agent, then it will be preceded by Agent:
- The same, only in reverse, is done in the branch where the chat id of the author.
It is also important to trim message with substring function so that if the message is too long, Telegram module won’t generate error and scenario will not stop.
For all other types of files (audio, video, document) you can simply add Caption of the client or author to make it clear “who” writes.
That’s all, this scheme works fine. The agent just observes the process, rather than passing every little thing manually from chat to chat. The delay between message transfers is 2-5 seconds, which does not affect the quality of communication at all. Well, thanks to Telegram for such features!
If something is not clear, ask in the comments. Happy automating!
I love SEO, marketing, I am passionate about automation and I hate manual work that can be delegated to machines.