How to correctly notify client about a bot joining a LiveChat

Description

I am trying to create a bot adapter which can automatically join a LiveChat and answer to livechat-guest. When a livechat-guest creates a room within the BOT department, I want to assign my bot agent into that LiveChat.

My current approach:

  1. I created an incoming webhook to listen to every incoming LiveChat in the BOT department.
  2. For each new LiveChat room created, RocketCat bot sends a “newRoom” command to a private channel inside BOT department.
  3. The bot takes every incoming LiveChat room.
  4. When the bot takes a LiveChat room via livechat/inquiries.take API, the livechat-guest receives a “connected” message with the type “command”.
  5. Depends on received “connected” message, on client-side, guest’s application setups information of the bot, in order to render messages correctly.

For the previous releases of RocketChat, this approach is working properly.

In the new release version 2.3.0 of RocketChat. There is a new feature that allows RocketChat to auto-assign a bot to a new LiveChat room. This feature would enable us to get rid of the webhook. However, since the bot won’t call the livechat/inquiries.take API anymore, the LiveChat room didn’t send back any “connected” message to the client-side. So, I cannot establish any information about the bot.

Did I do anything wrong? Or do you recommend any better approach for this situation? Thank you in advance.

Server Setup Information

  • Version of Rocket.Chat Server: 2.3.0
  • Operating System: Windows 10
  • Deployment Method: docker
  • Number of Running Instances: 1
  • NodeJS Version: v10.16.3
  • MongoDB Version: v4.0

Any additional Information

1 Like